Chromium Code Reviews| Index: content/shell/browser/layout_test/blink_test_controller.cc |
| diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc |
| index 0a5460823bd3c1354863413c0a2c2033d60baac6..2371eb503040a547073f5f33d99fcb5824ea8a15 100644 |
| --- a/content/shell/browser/layout_test/blink_test_controller.cc |
| +++ b/content/shell/browser/layout_test/blink_test_controller.cc |
| @@ -229,6 +229,7 @@ BlinkTestController::BlinkTestController() |
| switches::kEnableLeakDetection)), |
| crash_when_leak_found_(false), |
| devtools_frontend_(NULL), |
| + inspected_window_(NULL), |
|
dgozman
2017/03/10 00:17:17
nullptr
|
| render_process_host_observer_(this) { |
| CHECK(!instance_); |
| instance_ = this; |
| @@ -273,7 +274,7 @@ bool BlinkTestController::PrepareForLayoutTest( |
| if (test_url.spec().find("/inspector-unit/") == std::string::npos) |
| test_url_ = test_url; |
| else |
| - test_url_ = LayoutTestDevToolsFrontend::MapJSTestURL(test_url); |
| + test_url_ = LayoutTestDevToolsFrontend::MapUnitTestURL(test_url); |
| did_send_initial_test_configuration_ = false; |
| printer_->reset(); |
| frame_to_layout_dump_map_.clear(); |
| @@ -290,7 +291,27 @@ bool BlinkTestController::PrepareForLayoutTest( |
| // The W3C SVG layout tests use a different size than the other layout tests. |
| if (test_url_.spec().find("W3C-SVG-1.1") != std::string::npos) |
| initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip); |
| - if (!main_window_) { |
| + if (test_url_.spec().find("/devtools-js/") != std::string::npos) { |
| + if (devtools_frontend_ && inspected_window_) { |
| + inspected_window_->LoadURL(GURL(url::kAboutBlankURL)); |
|
dgozman
2017/03/10 00:17:17
Did we detach at the end of previous test? It woul
|
| + test_url_ = LayoutTestDevToolsFrontend::MapIntegrationTestURL(test_url); |
| + main_window_->LoadURL(test_url_); |
| + } else { |
| + inspected_window_ = content::Shell::CreateNewWindow( |
| + browser_context, GURL(), NULL, initial_size_); |
| + inspected_window_->LoadURL(GURL(url::kAboutBlankURL)); |
| + devtools_frontend_ = LayoutTestDevToolsFrontend::CreateDevToolsMainWindow( |
| + *inspected_window_, test_url_.spec()); |
| + main_window_ = devtools_frontend_->frontend_shell(); |
| + test_url_ = LayoutTestDevToolsFrontend::MapIntegrationTestURL(test_url); |
| + WebContentsObserver::Observe(main_window_->web_contents()); |
| + current_pid_ = base::kNullProcessId; |
| + default_prefs_ = main_window_->web_contents() |
| + ->GetRenderViewHost() |
| + ->GetWebkitPreferences(); |
| + main_window_->LoadURL(test_url_); |
| + } |
| + } else if (!main_window_) { |
| main_window_ = content::Shell::CreateNewWindow( |
| browser_context, |
| GURL(), |
| @@ -883,7 +904,8 @@ void BlinkTestController::OnCloseRemainingWindows() { |
| Shell* devtools_shell = devtools_frontend_ ? |
| devtools_frontend_->frontend_shell() : NULL; |
| for (size_t i = 0; i < open_windows.size(); ++i) { |
| - if (open_windows[i] != main_window_ && open_windows[i] != devtools_shell) |
| + if (open_windows[i] != main_window_ && open_windows[i] != devtools_shell && |
| + open_windows[i] != inspected_window_) |
| open_windows[i]->Close(); |
| } |
| base::RunLoop().RunUntilIdle(); |