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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/inspector-protocol-test.js

Issue 1638953002: [DevTools] Migrate device-emulation tests from OverridesSupport to inspector-protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/inspector-protocol-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/inspector-protocol-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/inspector-protocol-test.js
index f6c22bb9afc617dbfa5ce0150fa8e21a730e75fa..ed9a774c3961d4e7949bc835463e4a495d4e50e5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/inspector-protocol-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/inspector-protocol-test.js
@@ -72,12 +72,23 @@ function closeTest()
testRunner.notifyDone();
}
+var reloadParam = "__protocol__test__reload__";
+
function runTest()
{
if (!window.testRunner) {
console.error("This test requires DumpRenderTree");
return;
}
+
+ var reloadIndex = window.location.href.lastIndexOf(reloadParam);
+ if (reloadIndex !== -1) {
+ var lastId = window.location.href.substring(reloadIndex + reloadParam.length);
+ window.lastFrontendEvalId = parseInt(lastId, 10);
+ evaluateInFrontend("InspectorTest.pageReloaded();");
+ return;
+ }
+
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows(true);
@@ -96,6 +107,12 @@ function evaluateInFrontend(script)
testRunner.evaluateInWebInspector(++lastFrontendEvalId, script);
}
+function navigateProtocolTest(url)
+{
+ url += (url.indexOf("?") === -1 ? "?" : "&") + reloadParam + lastFrontendEvalId;
+ window.location.replace(url);
+}
+
function openInspector()
{
var scriptTags = document.getElementsByTagName("script");

Powered by Google App Engine
This is Rietveld 408576698