Changeset 66201 in webkit


Ignore:
Timestamp:
Aug 27, 2010 4:15:02 AM (14 years ago)
Author:
steveblock@google.com
Message:

2010-08-27 Steve Block <steveblock@google.com>

Reviewed by Darin Adler.

js-test-post.js is not robust for asynchronous tests
https://bugs.webkit.org/show_bug.cgi?id=44642

This patch moves finishJSTest() to js-test-pre.js to make it available for when an
asynchronous test completes before js-test-post.js has been parsed, and updates
js-test-post.js to handle this case.

  • fast/dom/Window/window-property-descriptors-expected.txt:
  • fast/js/resources/js-test-post.js:
  • fast/js/resources/js-test-pre.js: (finishJSTest):
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66200 r66201  
     12010-08-27  Steve Block  <steveblock@google.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        js-test-post.js is not robust for asynchronous tests
     6        https://bugs.webkit.org/show_bug.cgi?id=44642
     7
     8        This patch moves finishJSTest() to js-test-pre.js to make it available for when an
     9        asynchronous test completes before js-test-post.js has been parsed, and updates
     10        js-test-post.js to handle this case.
     11
     12        * fast/dom/Window/window-property-descriptors-expected.txt:
     13        * fast/js/resources/js-test-post.js:
     14        * fast/js/resources/js-test-pre.js:
     15        (finishJSTest):
     16
    1172010-08-27  Nikolas Zimmermann  <nzimmermann@rim.com>
    218
  • trunk/LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt

    r63326 r66201  
    348348PASS typeof Object.getOwnPropertyDescriptor(window, 'evalAndLog') is 'object'
    349349PASS typeof Object.getOwnPropertyDescriptor(window, 'event') is 'object'
     350PASS typeof Object.getOwnPropertyDescriptor(window, 'finishJSTest') is 'object'
    350351PASS typeof Object.getOwnPropertyDescriptor(window, 'frameElement') is 'object'
    351352PASS typeof Object.getOwnPropertyDescriptor(window, 'frames') is 'object'
  • trunk/LayoutTests/fast/js/resources/js-test-post.js

    r57109 r66201  
    1 function finishJSTest()
    2 {
    3     shouldBeTrue("successfullyParsed");
    4     debug('<br /><span class="pass">TEST COMPLETE</span>');
    5     if (window.jsTestIsAsync && window.layoutTestController)
    6         layoutTestController.notifyDone();
    7 }
     1wasPostTestScriptParsed = true;
    82
    93if (window.jsTestIsAsync) {
    104    if (window.layoutTestController)
    115        layoutTestController.waitUntilDone();
     6    if (window.wasFinishJSTestCalled)
     7        finishJSTest();
    128} else
    139    finishJSTest();
  • trunk/LayoutTests/fast/js/resources/js-test-pre.js

    r64796 r66201  
    281281    }
    282282}
     283
     284// It's possible for an async test to call finishJSTest() before js-test-post.js
     285// has been parsed.
     286function finishJSTest()
     287{
     288    wasFinishJSTestCalled = true;
     289    if (!window.wasPostTestScriptParsed)
     290        return;
     291    shouldBeTrue("successfullyParsed");
     292    debug('<br /><span class="pass">TEST COMPLETE</span>');
     293    if (window.jsTestIsAsync && window.layoutTestController)
     294        layoutTestController.notifyDone();
     295}
Note: See TracChangeset for help on using the changeset viewer.