Changeset 206117 in webkit
- Timestamp:
- Sep 19, 2016 2:07:31 PM (8 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206116 r206117 1 2016-09-19 Devin Rousso <dcrousso+webkit@gmail.com> 2 3 Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/unit-tests 4 https://bugs.webkit.org/show_bug.cgi?id=162103 5 6 Reviewed by Brian Burg. 7 8 Replace instances of singleFireEventListener with awaitEvent and use promise logic to make 9 tests more readable. 10 11 * inspector/unit-tests/inspector-test-dispatch-event-to-frontend.html: 12 * inspector/unit-tests/protocol-test-dispatch-event-to-frontend.html: 13 1 14 2016-09-19 Devin Rousso <dcrousso+webkit@gmail.com> 2 15 -
trunk/LayoutTests/inspector/unit-tests/inspector-test-dispatch-event-to-frontend.html
r195147 r206117 11 11 name: "InspectorTest.TestPage.dispatchEventToFrontend", 12 12 description: "Ensure TestPage.dispatchEventToFrontend works with an InspectorTest.", 13 test : (resolve, reject) =>{14 InspectorTest. evaluateInPage("TestPage.dispatchEventToFrontend('MyEvent', {count: 1})");15 InspectorTest.singleFireEventListener("MyEvent",(event) => {13 test(resolve, reject) { 14 InspectorTest.awaitEvent("MyEvent") 15 .then((event) => { 16 16 InspectorTest.pass("Received Event"); 17 17 InspectorTest.expectThat(event.type === "MyEvent", "Event name should be the event dispatched."); 18 18 InspectorTest.expectThat(event.data.count === 1, "Event data should be included."); 19 resolve(); 20 }); 19 }) 20 .then(resolve, reject); 21 22 InspectorTest.evaluateInPage("TestPage.dispatchEventToFrontend('MyEvent', {count: 1})"); 21 23 }, 22 24 }); -
trunk/LayoutTests/inspector/unit-tests/protocol-test-dispatch-event-to-frontend.html
r195147 r206117 11 11 name: "ProtocolTest.TestPage.dispatchEventToFrontend", 12 12 description: "Ensure TestPage.dispatchEventToFrontend works with a ProtocolTest.", 13 test : (resolve, reject) =>{14 ProtocolTest. evaluateInPage("TestPage.dispatchEventToFrontend('MyEvent', {count: 1})");15 ProtocolTest.singleFireEventListener("MyEvent",(event) => {13 test(resolve, reject) { 14 ProtocolTest.awaitEvent("MyEvent") 15 .then((event) => { 16 16 ProtocolTest.pass("Received Event"); 17 17 ProtocolTest.expectThat(event.type === "MyEvent", "Event name should be the event dispatched."); 18 18 ProtocolTest.expectThat(event.data.count === 1, "Event data should be included."); 19 resolve(); 20 }); 19 }) 20 .then(resolve, reject); 21 22 ProtocolTest.evaluateInPage("TestPage.dispatchEventToFrontend('MyEvent', {count: 1})"); 21 23 }, 22 24 });
Note: See TracChangeset
for help on using the changeset viewer.