Title: [206115] trunk/LayoutTests
Revision
206115
Author
commit-qu...@webkit.org
Date
2016-09-19 13:47:18 -0700 (Mon, 19 Sep 2016)

Log Message

Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/script-profiler
https://bugs.webkit.org/show_bug.cgi?id=162101

Patch by Devin Rousso <dcrousso+web...@gmail.com> on 2016-09-19
Reviewed by Brian Burg.

Replace instances of singleFireEventListener with awaitEvent and use promise logic to make
tests more readable.

* inspector/script-profiler/event-type-Other.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206114 => 206115)


--- trunk/LayoutTests/ChangeLog	2016-09-19 20:46:42 UTC (rev 206114)
+++ trunk/LayoutTests/ChangeLog	2016-09-19 20:47:18 UTC (rev 206115)
@@ -1,5 +1,17 @@
 2016-09-19  Devin Rousso  <dcrousso+web...@gmail.com>
 
+        Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/script-profiler
+        https://bugs.webkit.org/show_bug.cgi?id=162101
+
+        Reviewed by Brian Burg.
+
+        Replace instances of singleFireEventListener with awaitEvent and use promise logic to make
+        tests more readable.
+
+        * inspector/script-profiler/event-type-Other.html:
+
+2016-09-19  Devin Rousso  <dcrousso+web...@gmail.com>
+
         Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/page
         https://bugs.webkit.org/show_bug.cgi?id=162100
 

Modified: trunk/LayoutTests/inspector/script-profiler/event-type-Other.html (206114 => 206115)


--- trunk/LayoutTests/inspector/script-profiler/event-type-Other.html	2016-09-19 20:46:42 UTC (rev 206114)
+++ trunk/LayoutTests/inspector/script-profiler/event-type-Other.html	2016-09-19 20:47:18 UTC (rev 206115)
@@ -29,8 +29,9 @@
     suite.addTestCase({
         name: "TrackingSession",
         description: "Start a tracking session that includes multiple web script evaluations classified as an Other event type.",
-        test: function(resolve, reject) {
-            InspectorProtocol.awaitEvent({event: "ScriptProfiler.trackingStart"}).then((messageObject) => {
+        test(resolve, reject) {
+            InspectorProtocol.awaitEvent({event: "ScriptProfiler.trackingStart"})
+            .then((messageObject) => {
                 ProtocolTest.log("ScriptProfiler.trackingStart");
             });
 
@@ -39,9 +40,15 @@
                 ProtocolTest.expectThat(messageObject.params.event.type === "Other", "Event type should be Other.");
             });
 
-            InspectorProtocol.awaitEvent({event: "ScriptProfiler.trackingComplete"}).then((messageObject) => {
+            InspectorProtocol.awaitEvent({event: "ScriptProfiler.trackingComplete"})
+            .then((messageObject) => {
                 ProtocolTest.log("ScriptProfiler.trackingComplete");
-                resolve();
+            })
+            .then(resolve, reject);
+
+            ProtocolTest.awaitEvent("TestPageTimerEvaluated")
+            .then((event) => {
+                InspectorProtocol.sendCommand("ScriptProfiler.stopTracking", {});
             });
 
             InspectorProtocol.sendCommand("ScriptProfiler.startTracking", {});
@@ -48,9 +55,6 @@
             ProtocolTest.evaluateInPage("triggerScriptEvaluation()");
             ProtocolTest.evaluateInPage("triggerEventDispatchEvaluation()");
             ProtocolTest.evaluateInPage("triggerTimerEvaluation()");
-            ProtocolTest.singleFireEventListener("TestPageTimerEvaluated", (event) => {
-                InspectorProtocol.sendCommand("ScriptProfiler.stopTracking", {});
-            });
         }
     });
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to