Commit feed35d2 authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: pass the running test path into the devtools front-end.

This change passes testPath into the front-end instead of explicitly guessing the active panel.

Review URL: https://codereview.chromium.org/614023003

Cr-Commit-Position: refs/heads/master@{#297421}
parent f6ebbf6b
......@@ -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\\\"\"",
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment