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 2d27bdd91d6986e7ffbbac6078637d3188679cc7..07bb3d968ca34d5f7838aadeae8358a2abfc8610 100644 |
| --- a/content/shell/browser/layout_test/blink_test_controller.cc |
| +++ b/content/shell/browser/layout_test/blink_test_controller.cc |
| @@ -247,6 +247,7 @@ BlinkTestController* BlinkTestController::Get() { |
| BlinkTestController::BlinkTestController() |
| : main_window_(NULL), |
| + devtools_window_(nullptr), |
| test_phase_(BETWEEN_TESTS), |
| is_leak_detection_enabled_( |
| base::CommandLine::ForCurrentProcess()->HasSwitch( |
| @@ -514,7 +515,8 @@ void BlinkTestController::DevToolsProcessCrashed() { |
| DCHECK(CalledOnValidThread()); |
| printer_->AddErrorMessage("#CRASHED - devtools"); |
| devtools_bindings_.reset(); |
| - devtools_window_.reset(); |
| + if (devtools_window_) |
| + devtools_window_->Close(); |
|
dgozman
2017/04/12 16:59:25
devtools_window_ = nullptr;
|
| } |
| void BlinkTestController::WebContentsDestroyed() { |
| @@ -834,8 +836,8 @@ void BlinkTestController::OnShowDevTools(const std::string& settings, |
| if (!devtools_window_) { |
| ShellBrowserContext* browser_context = |
| ShellContentBrowserClient::Get()->browser_context(); |
| - devtools_window_.reset(content::Shell::CreateNewWindow( |
| - browser_context, GURL(), nullptr, initial_size_)); |
| + devtools_window_ = content::Shell::CreateNewWindow(browser_context, GURL(), |
| + nullptr, initial_size_); |
| } |
| devtools_bindings_.reset(LayoutTestDevToolsBindings::LoadDevTools( |
| @@ -914,8 +916,7 @@ void BlinkTestController::OnCloseRemainingWindows() { |
| DevToolsAgentHost::DetachAllClients(); |
| std::vector<Shell*> open_windows(Shell::windows()); |
| for (size_t i = 0; i < open_windows.size(); ++i) { |
| - if (open_windows[i] != main_window_ && |
| - open_windows[i] != devtools_window_.get()) |
| + if (open_windows[i] != main_window_ && open_windows[i] != devtools_window_) |
| open_windows[i]->Close(); |
| } |
| base::RunLoop().RunUntilIdle(); |