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

Unified Diff: content/shell/browser/layout_test/layout_test_devtools_bindings.cc

Issue 2837083003: DevTools: create test infrastructure so devtools drives the test (Closed)
Patch Set: Created 3 years, 8 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: content/shell/browser/layout_test/layout_test_devtools_bindings.cc
diff --git a/content/shell/browser/layout_test/layout_test_devtools_bindings.cc b/content/shell/browser/layout_test/layout_test_devtools_bindings.cc
index 529e1f99f6e241e706ad27ba35435694a1cc132b..94b0cfc88b45ac23b273c02683fa2671d75addf8 100644
--- a/content/shell/browser/layout_test/layout_test_devtools_bindings.cc
+++ b/content/shell/browser/layout_test/layout_test_devtools_bindings.cc
@@ -58,12 +58,24 @@ GURL LayoutTestDevToolsBindings::GetDevToolsPathAsURL(
}
// static.
-GURL LayoutTestDevToolsBindings::MapJSTestURL(const GURL& test_url) {
+GURL LayoutTestDevToolsBindings::MapIntegrationTestURL(const GURL& test_url) {
+ return MapJSTestURL(test_url, "integration_test_runner.html");
+}
+
+// static.
+GURL LayoutTestDevToolsBindings::MapUnitTestURL(const GURL& test_url) {
+ return MapJSTestURL(test_url, "unit_test_runner.html");
+}
+
+// static.
+GURL LayoutTestDevToolsBindings::MapJSTestURL(
+ const GURL& test_url,
+ const std::string& entry_filename) {
std::string url_string = GetDevToolsPathAsURL(std::string()).spec();
std::string inspector_file_name = "inspector.html";
size_t start_position = url_string.find(inspector_file_name);
url_string.replace(start_position, inspector_file_name.length(),
- "unit_test_runner.html");
+ entry_filename);
url_string += "&test=" + test_url.spec();
return GURL(url_string);
}
@@ -77,6 +89,7 @@ LayoutTestDevToolsBindings* LayoutTestDevToolsBindings::LoadDevTools(
LayoutTestDevToolsBindings* bindings =
new LayoutTestDevToolsBindings(devtools_contents_, inspected_contents_);
bindings->SetPreferences(settings);
+ bindings->CreateFrontendHost(devtools_contents_->GetMainFrame());
dgozman 2017/04/25 21:08:28 I now think we can just remove this call. Could yo
chenwilliam 2017/06/15 01:01:05 Done.
GURL devtools_url =
LayoutTestDevToolsBindings::GetDevToolsPathAsURL(frontend_url);
NavigationController::LoadURLParams params(devtools_url);
@@ -84,7 +97,6 @@ LayoutTestDevToolsBindings* LayoutTestDevToolsBindings::LoadDevTools(
ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
bindings->web_contents()->GetController().LoadURLWithParams(params);
bindings->web_contents()->Focus();
- bindings->CreateFrontendHost();
return bindings;
}

Powered by Google App Engine
This is Rietveld 408576698