[webkit-changes] cvs commit: LayoutTests/fast/js test-isPrototypeOf-expected.txt test-isPrototypeOf.html

Anders andersca at opensource.apple.com
Sun Dec 18 05:27:35 PST 2005


andersca    05/12/18 05:27:35

  Modified:    .        ChangeLog
  Added:       fast/js  test-isPrototypeOf-expected.txt
                        test-isPrototypeOf.html
  Log:
  2005-12-18  Anders Carlsson  <andersca at mac.com>
  
          Reviewed by Darin.
  
          Test case for http://bugzilla.opendarwin.org/show_bug.cgi?id=4000
          Object.prototype is missing isPrototypeOf
  
          * fast/js/test-isPrototypeOf-expected.txt: Added.
          * fast/js/test-isPrototypeOf.html: Added.
  
  Revision  Changes    Path
  1.164     +10 -0     LayoutTests/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/LayoutTests/ChangeLog,v
  retrieving revision 1.163
  retrieving revision 1.164
  diff -u -r1.163 -r1.164
  --- ChangeLog	18 Dec 2005 03:09:40 -0000	1.163
  +++ ChangeLog	18 Dec 2005 13:27:34 -0000	1.164
  @@ -1,3 +1,13 @@
  +2005-12-14  Anders Carlsson  <andersca at mac.com>
  +
  +        Reviewed by Darin.
  +
  +        Test case for http://bugzilla.opendarwin.org/show_bug.cgi?id=4000
  +        Object.prototype is missing isPrototypeOf
  + 
  +        * fast/js/test-isPrototypeOf-expected.txt: Added.
  +        * fast/js/test-isPrototypeOf.html: Added.
  +
   2005-12-17  Geoffrey Garen  <ggaren at apple.com>
   
           Layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6119
  
  
  
  1.1                  LayoutTests/fast/js/test-isPrototypeOf-expected.txt
  
  Index: test-isPrototypeOf-expected.txt
  ===================================================================
  This tests that isPrototypeOf works according to the ECMA spec. If this test is successful, "SUCCESS" should be shown below.
  
  SUCCESS!
  
  
  
  
  1.1                  LayoutTests/fast/js/test-isPrototypeOf.html
  
  Index: test-isPrototypeOf.html
  ===================================================================
  <html>
    <head>
      <script>
          function debug(str) {
              var c = document.getElementById('console')
              c.innerHTML += str + "<br>"
          }
      
          function runTests () {
              if (window.layoutTestController)
                  layoutTestController.dumpAsText();
                  
              if (Object.isPrototypeOf('string') != false) {
                  debug('FAILURE: isPrototype should return false if the argument is not an object')
                  return;
              }
              
              if (Array.prototype.isPrototypeOf(new Array()) != true) {
                  debug('FAILURE: Array.prototype should be prototype of newly created arrays')
                  return;
              }
              
              function ObjectA () { }
              function ObjectB () { }
              ObjectB.prototype = new ObjectA()
              
              var objb = new ObjectB()
              
              if (ObjectA.prototype.isPrototypeOf(objb) != true) {
                  debug('FAILURE: ObjectA.prototype should be prototype of newly created ObjectB objects')
                  return;
              }
              
              function ObjectC () {}
              ObjectC.prototype = new ObjectB()
              
              var objc = new ObjectC()
              
              if (ObjectA.prototype.isPrototypeOf(objc) != true) {
                  debug('FAILURE: ObjectA.prototype should be prototype of newly created ObjectC objects')
                  return;
              }
              debug('SUCCESS!')
          }
      </script>
    </head>
  <body onload="runTests();">
  	 <p>This tests that isPrototypeOf works according to the ECMA spec. If this test is successful, "SUCCESS" should be shown below.</p>
      <pre id="console"></pre>
    </body>
  </html>
  
  
  



More information about the webkit-changes mailing list