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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html

Issue 2402513004: [Devtools] Fixed flakey network test (Closed)
Patch Set: Merge branch 'master' into FIX_COLUMNS_TEST Created 4 years, 2 months 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html
index 7f445af159d4f99afa39f013535c8fdc37e8dabb..97ba0fc46f38c0f9c91ae49199c9f1e61b9e4310 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html
@@ -12,16 +12,39 @@ function sendXHRRequest() {
function test() {
var columnsToTest = ["name", "method", "status", "protocol", "scheme", "domain", "remoteaddress", "type", "initiator", "cookies", "setcookies", "priority", "cache-control", "connection", "content-encoding", "content-length", "vary"];
+ var xhrRequestFinished = false;
+ var xhrNode = null;
+
function onNodeInserted(node)
{
if (node.request().name() !== "empty.html?xhr")
return;
+ xhrNode = node;
+ checkComplete();
+ }
+
+ function onRequestFinished(data)
+ {
+ var request = data.data;
+ if (request.name() !== "empty.html?xhr")
+ return;
+ xhrRequestFinished = true;
+ WebInspector.panels.network._networkLogView.refresh();
+ checkComplete();
+ }
+
+ // Nodes may be inserted or updated in different orders. We must have both to continue to prevent flakeyness.
+ function checkComplete()
+ {
+ if (!xhrNode || !xhrRequestFinished)
+ return;
for (var columnName of columnsToTest)
- InspectorTest.addResult(columnName + ": " + node.createCell(columnName).textContent);
+ InspectorTest.addResult(columnName + ": " + xhrNode.createCell(columnName).textContent);
InspectorTest.completeTest();
}
InspectorTest.recordNetwork();
+ InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequestFinished);
InspectorTest.addSniffer(WebInspector.panels.network._networkLogView._dataGrid, "insertChild", onNodeInserted, true);
InspectorTest.NetworkAgent.setCacheDisabled(true, InspectorTest.evaluateInPage.bind(null, "sendXHRRequest()"));
}
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698