Changeset 195147 in webkit


Ignore:
Timestamp:
Jan 15, 2016 2:21:41 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

LayoutTest inspector/script-profiler/event-type-Other.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=153016
<rdar://problem/24192919>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-01-15
Reviewed by Brian Burg.

Introduce a better way for the inspected page to signal to
the inspector page by dispatching an event with JSON data.
Use it in this test to try to eliminate flakyness.

  • http/tests/inspector/resources/inspector-test.js:

(TestPage.dispatchEventToFrontend):

  • http/tests/inspector/resources/protocol-test.js:

(TestPage.runTest.window.runTest):
(TestPage.dispatchEventToFrontend):

  • inspector/script-profiler/event-type-Other.html:
  • inspector/unit-tests/inspector-test-dispatch-event-to-frontend-expected.txt: Added.
  • inspector/unit-tests/inspector-test-dispatch-event-to-frontend.html: Added.
  • inspector/unit-tests/protocol-test-dispatch-event-to-frontend-expected.txt: Added.
  • inspector/unit-tests/protocol-test-dispatch-event-to-frontend.html: Added.
  • platform/mac/TestExpectations:
Location:
trunk/LayoutTests
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195146 r195147  
     12016-01-15  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        LayoutTest inspector/script-profiler/event-type-Other.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=153016
     5        <rdar://problem/24192919>
     6
     7        Reviewed by Brian Burg.
     8
     9        Introduce a better way for the inspected page to signal to
     10        the inspector page by dispatching an event with JSON data.
     11        Use it in this test to try to eliminate flakyness.
     12
     13        * http/tests/inspector/resources/inspector-test.js:
     14        (TestPage.dispatchEventToFrontend):
     15        * http/tests/inspector/resources/protocol-test.js:
     16        (TestPage.runTest.window.runTest):
     17        (TestPage.dispatchEventToFrontend):
     18        * inspector/script-profiler/event-type-Other.html:
     19        * inspector/unit-tests/inspector-test-dispatch-event-to-frontend-expected.txt: Added.
     20        * inspector/unit-tests/inspector-test-dispatch-event-to-frontend.html: Added.
     21        * inspector/unit-tests/protocol-test-dispatch-event-to-frontend-expected.txt: Added.
     22        * inspector/unit-tests/protocol-test-dispatch-event-to-frontend.html: Added.
     23        * platform/mac/TestExpectations:
     24
    1252016-01-15  Zalan Bujtas  <zalan@apple.com>
    226
  • trunk/LayoutTests/http/tests/inspector/resources/inspector-test.js

    r194704 r195147  
    140140}
    141141
     142TestPage.dispatchEventToFrontend = function(eventName, data)
     143{
     144    let dispatchEventCodeString = `InspectorTest.dispatchEventToListeners(${JSON.stringify(eventName)}, ${JSON.stringify(data)});`;
     145    testRunner.evaluateInWebInspector(dispatchEventCodeString);
     146};
     147
    142148TestPage.allowUncaughtExceptions = false;
    143149TestPage.needToSanitizeUncaughtExceptionURLs = false;
  • trunk/LayoutTests/http/tests/inspector/resources/protocol-test.js

    r188639 r195147  
    118118    }
    119119
    120     let inspectorFrontend = window.internals.openDummyInspectorFrontend(url);
    121     inspectorFrontend.addEventListener("load", (event) => {
     120    TestPage.inspectorFrontend = window.internals.openDummyInspectorFrontend(url);
     121    TestPage.inspectorFrontend.addEventListener("load", (event) => {
    122122        let initializationCodeString = `(${runInitializationMethodsInFrontend.toString()})([${TestPage._initializers}]);`;
    123123        let testFunctionCodeString = `(${runTestMethodInFrontend.toString()})(${testFunction.toString()});`;
    124124
    125         inspectorFrontend.postMessage(initializationCodeString, "*");
    126         inspectorFrontend.postMessage(testFunctionCodeString, "*");
     125        TestPage.inspectorFrontend.postMessage(initializationCodeString, "*");
     126        TestPage.inspectorFrontend.postMessage(testFunctionCodeString, "*");
    127127    });
    128128};
     129
     130TestPage.dispatchEventToFrontend = function(eventName, data)
     131{
     132    let dispatchEventCodeString = `ProtocolTest.dispatchEventToListeners(${JSON.stringify(eventName)}, ${JSON.stringify(data)});`;
     133    TestPage.inspectorFrontend.postMessage(dispatchEventCodeString, "*");
     134};
  • trunk/LayoutTests/inspector/script-profiler/event-type-Other.html

    r194871 r195147  
    1919    setTimeout(() => {
    2020        console.log("timer fired");
     21        TestPage.dispatchEventToFrontend("TestPageTimerEvaluated");
    2122    }, 0);
    2223}
     
    5051            ProtocolTest.evaluateInPage("triggerEventDispatchEvaluation()");
    5152            ProtocolTest.evaluateInPage("triggerTimerEvaluation()");
    52             setTimeout(() => { InspectorProtocol.sendCommand("ScriptProfiler.stopTracking", {}); }, 50);
     53            ProtocolTest.singleFireEventListener("TestPageTimerEvaluated", (event) => {
     54                InspectorProtocol.sendCommand("ScriptProfiler.stopTracking", {});
     55            });
    5356        }
    5457    });
  • trunk/LayoutTests/platform/mac/TestExpectations

    r195087 r195147  
    12421242webkit.org/b/152029 inspector/debugger/command-line-api-exception.html [ Pass Timeout ]
    12431243
    1244 webkit.org/b/153016 inspector/script-profiler/event-type-Other.html [ Pass Failure ]
    1245 
    12461244webkit.org/b/153108 [ Debug ] inspector/model/scope-chain-node.html [ Pass Timeout ]
    12471245
Note: See TracChangeset for help on using the changeset viewer.