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

Unified Diff: content/shell/renderer/test_runner/test_interfaces.cc

Issue 614023003: DevTools: pass the running test path into the devtools front-end. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/test_interfaces.cc
diff --git a/content/shell/renderer/test_runner/test_interfaces.cc b/content/shell/renderer/test_runner/test_interfaces.cc
index 63f2b271e4d0afb7263b5103fc2686dae96ddc86..4289fb4976863f9a3ddbc4c47240fdcd1659bce7 100644
--- a/content/shell/renderer/test_runner/test_interfaces.cc
+++ b/content/shell/renderer/test_runner/test_interfaces.cc
@@ -118,11 +118,19 @@ void TestInterfaces::ConfigureForTestWithURL(const blink::WebURL& test_url,
std::string settings = "";
std::string test_path = spec.substr(spec.find("/inspector/") + 11);
size_t slash_index = test_path.find("/");
+ std::string test_path_setting = base::StringPrintf(
+ "\"testPath\":\"\\\"%s\\\"\"", spec.c_str());
+
+ // TODO(pfeldman): remove once migrated to testPath.
+ std::string last_active_panel;
if (slash_index != std::string::npos) {
- settings = base::StringPrintf("{\"lastActivePanel\":\"\\\"%s\\\"\"}",
- test_path.substr(0, slash_index).c_str());
+ last_active_panel = base::StringPrintf(
+ ",\"lastActivePanel\":\"\\\"%s\\\"\"",
apavlov 2014/09/30 13:59:42 let's move this comma into the "{%s%s}" pattern be
+ test_path.substr(0, slash_index).c_str());
}
- test_runner_->ShowDevTools(settings, std::string());
+
+ test_runner_->ShowDevTools(base::StringPrintf("{%s%s}",
+ test_path_setting.c_str(), last_active_panel.c_str()), std::string());
}
if (spec.find("/viewsource/") != std::string::npos) {
test_runner_->setShouldEnableViewSource(true);
« 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