Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/network/resource-type.html

Issue 2592663002: Deflake inspector-protocol/network/resource-type.html (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector-protocol/network/resource-type.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/network/resource-type.html b/third_party/WebKit/LayoutTests/inspector-protocol/network/resource-type.html
index 2d0c3a5327051b52ccb4da7e7194712ae3ce85e8..e7ed7c852ac475b86457b19fb9152b808b9b571d 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/network/resource-type.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/network/resource-type.html
@@ -13,6 +13,7 @@ function appendIframe()
function test()
{
InspectorTest.eventHandler["Network.responseReceived"] = onResponseReceived;
+ InspectorTest.eventHandler["Network.loadingFinished"] = onLoadingFinished;
function enableNetwork()
{
@@ -60,10 +61,7 @@ function test()
}
resource.gotType = type;
resource.gotUrl = url;
- if ("responseAvailable" in resource)
- onResponseReady();
- else
- InspectorTest.sendCommand("Network.getResponseBody", { "requestId": requestId }, onResponseBody.bind(null, resource));
+ resource.requestId = requestId;
return;
}
}
@@ -71,6 +69,21 @@ function test()
InspectorTest.completeTest();
}
+ function onLoadingFinished(event)
+ {
+ const requestId = event.params.requestId;
+ for (const resource of resources) {
+ if (resource.requestId !== requestId) {
+ continue;
+ }
+ if ("responseAvailable" in resource) {
+ onResponseReady();
+ } else {
+ InspectorTest.sendCommand("Network.getResponseBody", { "requestId": requestId }, onResponseBody.bind(null, resource));
+ }
+ }
+ }
+
function onResponseReady()
{
resourcesLeft -= 1;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698