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

Log Message

Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/page
https://bugs.webkit.org/show_bug.cgi?id=162100

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/page/searchInResources.html:

Modified Paths

Diff

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


--- trunk/LayoutTests/ChangeLog	2016-09-19 20:45:52 UTC (rev 206113)
+++ trunk/LayoutTests/ChangeLog	2016-09-19 20:46:42 UTC (rev 206114)
@@ -1,5 +1,17 @@
 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
+
+        Reviewed by Brian Burg.
+
+        Replace instances of singleFireEventListener with awaitEvent and use promise logic to make
+        tests more readable.
+
+        * inspector/page/searchInResources.html:
+
+2016-09-19  Devin Rousso  <dcrousso+web...@gmail.com>
+
         Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/storage
         https://bugs.webkit.org/show_bug.cgi?id=162102
 

Modified: trunk/LayoutTests/inspector/page/searchInResources.html (206113 => 206114)


--- trunk/LayoutTests/inspector/page/searchInResources.html	2016-09-19 20:45:52 UTC (rev 206113)
+++ trunk/LayoutTests/inspector/page/searchInResources.html	2016-09-19 20:46:42 UTC (rev 206114)
@@ -32,7 +32,7 @@
     suite.addTestCase({
         name: "SearchAllResources",
         description: "Able to find text results in different resources.",
-        test: (resolve, reject) => {
+        test(resolve, reject) {
             PageAgent.searchInResources(searchString, (error, results) => {
                 InspectorTest.assert(!error, "Should not be a protocol error.");
                 InspectorTest.expectThat(results.length > 0, "Should find results in multiple resources.");
@@ -47,7 +47,7 @@
     suite.addTestCase({
         name: "SearchInScriptResource",
         description: "Able to find text results in an individual Script resource.",
-        test: (resolve, reject) => {
+        test(resolve, reject) {
             let result = searchResults.find((result) => /search-script\.js$/.test(result.url));
             if (!result)
                 reject();
@@ -65,7 +65,7 @@
     suite.addTestCase({
         name: "SearchInXHRResource",
         description: "Able to find text results in an individual XHR resource.",
-        test: (resolve, reject) => {
+        test(resolve, reject) {
             let result = searchResults.find((result) => /search-xhr\.txt$/.test(result.url));
             if (!result)
                 reject();
@@ -83,10 +83,12 @@
         }
     });
 
-    InspectorTest.evaluateInPage("triggerDownloadingResources()");
-    InspectorTest.singleFireEventListener("PageIsReady", (event) => {
+    InspectorTest.awaitEvent("PageIsReady")
+    .then((event) => {
         suite.runTestCasesAndFinish();
     });
+
+    InspectorTest.evaluateInPage("triggerDownloadingResources()");
 }
 </script>
 </head>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to