[webkit-changes] cvs commit: WebCore/layout-tests/fast/js exception-linenums-expected.txt exception-linenums.html

Darin darin at opensource.apple.com
Fri Jun 10 11:02:57 PDT 2005


darin       05/06/10 11:02:57

  Modified:    .        ChangeLog
  Added:       layout-tests/fast/js exception-linenums-expected.txt
                        exception-linenums.html
  Log:
          Change by Mark Rowe <opendarwin.org at bdash.net.nz>.
          Refined and reviewed by me.
  
          - test for exception file/line number fix
            http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
  
          * layout-tests/fast/js/exception-linenums-expected.txt: Added.
          * layout-tests/fast/js/exception-linenums.html: Added.
  
  Revision  Changes    Path
  1.4254    +11 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4253
  retrieving revision 1.4254
  diff -u -r1.4253 -r1.4254
  --- ChangeLog	10 Jun 2005 06:47:32 -0000	1.4253
  +++ ChangeLog	10 Jun 2005 18:02:54 -0000	1.4254
  @@ -1,3 +1,14 @@
  +2005-06-10  Darin Adler  <darin at apple.com>
  +
  +        Change by Mark Rowe <opendarwin.org at bdash.net.nz>.
  +        Refined and reviewed by me.
  +
  +        - test for exception file/line number fix
  +          http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
  +
  +        * layout-tests/fast/js/exception-linenums-expected.txt: Added.
  +        * layout-tests/fast/js/exception-linenums.html: Added.
  +
   2005-06-09  David Hyatt  <hyatt at apple.com>
   
   	Fix from Carston Guenther for bugzilla bug 3236.
  
  
  
  1.1                  WebCore/layout-tests/fast/js/exception-linenums-expected.txt
  
  Index: exception-linenums-expected.txt
  ===================================================================
  This test exercises the source URL and line number that is embedded in JavaScript exceptions, which is displayed in places like the JavaScript console.
  
  If the test passes, you should see five exceptions caught below, with the appropriate line number for each (increasing except for the last one).
  
  Exception at line 37 with sourceURL set
  Exception at line 45 with sourceURL set
  Exception at line 53 with sourceURL set
  Exception at line 61 with sourceURL set
  Exception at line 13 with sourceURL set
  
  
  
  
  1.1                  WebCore/layout-tests/fast/js/exception-linenums.html
  
  Index: exception-linenums.html
  ===================================================================
  <html>
      <head>
          <script type="text/javascript">
              function print(message)
              {
                  var paragraph = document.createElement("li");
                  paragraph.appendChild(document.createTextNode(message));
                  document.getElementById("console").appendChild(paragraph);
              }
  
              function exceptionInFunction()
              {
                  throw Exception();
              }
  
              function writeException(e)
              {
                  var type = 'unset';
                  if (e.sourceURL)
                      type = 'set';
                  
                  print('Exception at line ' + e.line + ' with sourceURL ' + type);
              }
  
              function expectedException()
              {
                  print('An exception was expected but not thrown.');
              }
  
              function test() {
                  if (window.layoutTestController) {
                      layoutTestController.dumpAsText();
                  }
  
                  try {
                      // Raises an exception that gets picked up by KJS_CHECKEXCEPTION
                      document.documentElement.innerHTML(foo);
                      expectedException();
                  } catch (e) {
                      writeException(e);
                  }  
  
                  try {
                      // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONVALUE
                      document.documentElement.style.backgroundColor = 'as';
                      expectedException();
                  } catch (e) {
                      writeException(e);
                  }
  
                  try {
                      // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONREFERENCE
                      document.documentElement.appendChild('').innerHTML = '';
                      expectedException();
                  } catch (e) {
                      writeException(e);
                  }
  
                  try {
                      // Raises an exception that gets picked up by KJS_CHECKEXCEPTIONLIST
                      document.getElementById(1());
                      expectedException();
                  } catch (e) {
                      writeException(e);
                  }
  
                  try {
                      // Raises an exception inside a function to check that its line number
                      // isn't overwritten in the assignment node.
                      var a = exceptionInFunction();
                      expectedException();
                  } catch (e) {
                      writeException(e);
                  }
              }
          </script>
      </head>
      <body onload="test()">
          <p>This test exercises the source URL and line number that is embedded in JavaScript exceptions, which is displayed in places like the JavaScript console.</p>
          <p>If the test passes, you should see five exceptions caught below, with the appropriate line number for each (increasing except for the last one).</p>
          <hr>
          <p><ol id=console></ol></p>
      </body>
  </html>
  
  
  



More information about the webkit-changes mailing list