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

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: rebaseline Created 3 years, 6 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..2ec94572fd87db5aec22871111d6028d2be99721 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,26 @@ GURL LayoutTestDevToolsBindings::GetDevToolsPathAsURL(
}
// static.
-GURL LayoutTestDevToolsBindings::MapJSTestURL(const GURL& test_url) {
+GURL LayoutTestDevToolsBindings::MapTestURLIfNeeded(const GURL& test_url,
+ bool* is_devtools_js_test) {
+ std::string spec = test_url.spec();
+ *is_devtools_js_test = spec.find("/devtools-js/") != std::string::npos;
+ bool is_unit_test = spec.find("/inspector-unit/") != std::string::npos;
+ if (!*is_devtools_js_test && !is_unit_test)
+ return test_url;
+ return MapJSTestURL(test_url, is_unit_test ? "unit_test_runner.html"
+ : "integration_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);
}
@@ -84,7 +98,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;
}
« no previous file with comments | « content/shell/browser/layout_test/layout_test_devtools_bindings.h ('k') | content/shell/browser/shell_devtools_bindings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698