[macOS debug] LayoutTest inspector/worker/resources-in-worker.html is a flaky timeout
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2018 22:29:37 +0000 (22:29 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2018 22:29:37 +0000 (22:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168091

Reviewed by Devin Rousso.

* inspector/worker/resources-in-worker-expected.txt:
* inspector/worker/resources-in-worker.html:
* inspector/worker/resources/resource-utilities.js:
* inspector/worker/resources/worker-resources.js:
Be a little more careful about proceeding with tests after starting the Worker.
Fix the resource load from the main target to actually load a real resource.

* inspector/dom-debugger/resources/dataXHR.json: Added.
* inspector/dom-debugger/xhr-breakpoints.html:
Load an actual resource.

* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
This test always passes for me in Release and Debug. Reset expectations.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234821 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/dom-debugger/resources/dataXHR.json [new file with mode: 0644]
LayoutTests/inspector/dom-debugger/xhr-breakpoints.html
LayoutTests/inspector/worker/resources-in-worker-expected.txt
LayoutTests/inspector/worker/resources-in-worker.html
LayoutTests/inspector/worker/resources/resource-utilities.js
LayoutTests/inspector/worker/resources/worker-resources.js
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations

index f380387..e8bcc0d 100644 (file)
@@ -1,3 +1,25 @@
+2018-08-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        [macOS debug] LayoutTest inspector/worker/resources-in-worker.html is a flaky timeout
+        https://bugs.webkit.org/show_bug.cgi?id=168091
+
+        Reviewed by Devin Rousso.
+
+        * inspector/worker/resources-in-worker-expected.txt:
+        * inspector/worker/resources-in-worker.html:
+        * inspector/worker/resources/resource-utilities.js:
+        * inspector/worker/resources/worker-resources.js:
+        Be a little more careful about proceeding with tests after starting the Worker.
+        Fix the resource load from the main target to actually load a real resource.
+
+        * inspector/dom-debugger/resources/dataXHR.json: Added.
+        * inspector/dom-debugger/xhr-breakpoints.html:
+        Load an actual resource.
+
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+        This test always passes for me in Release and Debug. Reset expectations.
+
 2018-08-13  Ali Juma  <ajuma@chromium.org>
 
         [IntersectionObserver] Validate threshold values
diff --git a/LayoutTests/inspector/dom-debugger/resources/dataXHR.json b/LayoutTests/inspector/dom-debugger/resources/dataXHR.json
new file mode 100644 (file)
index 0000000..a9981b9
--- /dev/null
@@ -0,0 +1 @@
+{"webkit":true, "type":"XHR"}
index e1591c3..e765ea5 100644 (file)
@@ -69,7 +69,7 @@ function test()
             WI.domDebuggerManager.allRequestsBreakpoint.disabled = false;
 
             InspectorTest.log("Sending XMLHttpRequest.");
-            InspectorTest.evaluateInPage("loadResourceXHR()");
+            InspectorTest.evaluateInPage(`loadResourceXHR("resources/dataXHR.json")`);
 
             WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused)
             .then(() => {
@@ -97,7 +97,7 @@ function test()
                 expectedBreakpointURL = breakpoint.url;
 
                 InspectorTest.log("Sending XMLHttpRequest.");
-                InspectorTest.evaluateInPage("loadResourceXHR()");
+                InspectorTest.evaluateInPage(`loadResourceXHR("resources/dataXHR.json")`);
                 return WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused);
             })
             .then(() => {
@@ -125,7 +125,7 @@ function test()
                 expectedBreakpointURL = breakpoint.url;
 
                 InspectorTest.log("Sending XMLHttpRequest.");
-                InspectorTest.evaluateInPage("loadResourceXHR()");
+                InspectorTest.evaluateInPage(`loadResourceXHR("resources/dataXHR.json")`);
                 return WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused);
             })
             .then(() => {
@@ -153,7 +153,7 @@ function test()
                 InspectorTest.log("Breakpoint disabled.");
 
                 InspectorTest.log("Sending XMLHttpRequest.");
-                return Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]);
+                return Promise.race([awaitEvaluateInPage(`loadResourceXHR("resources/dataXHR.json")`), rejectOnPause()]);
             })
             .then(() => {
                 InspectorTest.pass("Should not pause for disabled breakpoint.");
@@ -171,7 +171,7 @@ function test()
             addBreakpoint(WI.XHRBreakpoint.Type.Text, "nonexistant-url")
             .then((breakpoint) => {
                 InspectorTest.log("Sending XMLHttpRequest.");
-                return Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]);
+                return Promise.race([awaitEvaluateInPage(`loadResourceXHR("resources/dataXHR.json")`), rejectOnPause()]);
             })
             .then(() => {
                 InspectorTest.pass("Should not pause for breakpoint with different URL.");
@@ -191,7 +191,7 @@ function test()
                 WI.domDebuggerManager.removeXHRBreakpoint(breakpoint);
                 InspectorTest.log("Breakpoint removed.");
 
-                return Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]);
+                return Promise.race([awaitEvaluateInPage(`loadResourceXHR("resources/dataXHR.json")`), rejectOnPause()]);
             })
             .then(() => {
                 InspectorTest.pass("Should not pause for removed breakpoint.");
@@ -213,7 +213,7 @@ function test()
                 WI.domDebuggerManager.removeXHRBreakpoint(breakpoint);
                 InspectorTest.log("Breakpoint removed.");
 
-                return Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]);
+                return Promise.race([awaitEvaluateInPage(`loadResourceXHR("resources/dataXHR.json")`), rejectOnPause()]);
             })
             .then(() => {
                 InspectorTest.pass("Should not pause for removed disabled breakpoint.");
index d4207d1..3c2bc41 100644 (file)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: The requested URL was not found on this server.
 Test for Resources in a Worker.
 
 
index b2c567f..2867771 100644 (file)
@@ -15,7 +15,7 @@ function triggerWorkerStart() {
 }
 
 function triggerMainResourceLoadXHR() {
-    loadResourceXHR();
+    loadResourceXHR("resources/dataXHR.json?main");
 }
 
 function triggerWorkerResourceLoadXHR() {
@@ -23,7 +23,7 @@ function triggerWorkerResourceLoadXHR() {
 }
 
 function triggerMainResourceLoadFetch() {
-    loadResourceFetch();
+    loadResourceFetch("resources/dataFetch.json?main");
 }
 
 function triggerWorkerResourceLoadFetch() {
@@ -55,14 +55,24 @@ function test()
         test(resolve, reject) {
             InspectorTest.evaluateInPage("triggerWorkerStart()");
 
+            let workerIsReady = false;
+            let workerTargetIsSet = false;
+            function attemptResolve() {
+                if (workerIsReady && workerTargetIsSet)
+                    resolve();
+            }
+
             WI.targetManager.singleFireEventListener(WI.TargetManager.Event.TargetAdded, (event) => {
                 workerTarget = event.data.target;
                 InspectorTest.assert(workerTarget instanceof WI.Target);
                 InspectorTest.expectEqual(workerTarget.type, WI.Target.Type.Worker, "Added Target should have Worker type.");
+                workerTargetIsSet = true;
+                attemptResolve();
             });
 
             InspectorTest.singleFireEventListener("WorkerIsReady", () => {
-                resolve();
+                workerIsReady = true;
+                attemptResolve();
             });
         }
     });
index d33ef26..b2a08cf 100644 (file)
@@ -1,9 +1,9 @@
-function loadResourceXHR() {
+function loadResourceXHR(path) {
     let xhr = new XMLHttpRequest;
-    xhr.open("GET", "dataXHR.json", true);
+    xhr.open("GET", path, true);
     xhr.send();
 }
 
-function loadResourceFetch() {
-    fetch("dataFetch.json");
+function loadResourceFetch(path) {
+    fetch(path);
 }
index a54d480..d38da8a 100644 (file)
@@ -6,9 +6,9 @@ function importScript() {
 
 onmessage = function(event) {
     if (event.data === "loadResourceXHR")
-        loadResourceXHR();
+        loadResourceXHR("dataXHR.json");
     else if (event.data === "loadResourceFetch")
-        loadResourceFetch();
+        loadResourceFetch("dataFetch.json");
     else if (event.data === "importScript")
         importScript();
 }
index e48297b..955d55d 100644 (file)
@@ -3345,8 +3345,6 @@ webkit.org/b/176649 fast/text/international/synthesized-italic-vertical.html [ I
 webkit.org/b/177294 platform/gtk/fonts/fontconfig-aliasing-settings.html [ Failure ]
 webkit.org/b/177294 fast/text/fitzpatrick-combination.html [ ImageOnlyFailure ]
 
-webkit.org/b/175661 inspector/worker/resources-in-worker.html [ Failure ]
-
 webkit.org/b/175662 inspector/canvas/recording-2d.html [ Failure ]
 
 webkit.org/b/177934 fast/dom/HTMLLinkElement/preconnect-support.html [ Failure ]
index 9cb6a5d..b4f00d6 100644 (file)
@@ -1112,7 +1112,6 @@ webkit.org/b/158006 inspector/console/console-time.html [ Pass Timeout ]
 webkit.org/b/183880 [ Debug ] inspector/console/messageAdded-from-named-evaluations.html [ Slow ]
 webkit.org/b/156634 inspector/formatting/formatting-javascript.html [ Pass Timeout ]
 webkit.org/b/158948 inspector/timeline [ Pass Timeout ]
-webkit.org/b/168091 inspector/worker/resources-in-worker.html [ Pass Failure ]
 
 webkit.org/b/187622 [ Debug ] inspector/view/asynchronous-layout.html [ Pass Timeout ]