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

Unified Diff: content/shell/browser/webkit_test_controller.cc

Issue 870883008: Test runner: make inspector tests reuse a single inspector process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing Created 5 years, 11 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 | « content/shell/browser/webkit_test_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/webkit_test_controller.cc
diff --git a/content/shell/browser/webkit_test_controller.cc b/content/shell/browser/webkit_test_controller.cc
index 3712d32fe4759afd069aac557f05fea6c990e084..a4dc574151194b3024611ce5e074792ddbb36ffd 100644
--- a/content/shell/browser/webkit_test_controller.cc
+++ b/content/shell/browser/webkit_test_controller.cc
@@ -205,7 +205,8 @@ WebKitTestController::WebKitTestController()
is_leak_detection_enabled_(
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableLeakDetection)),
- crash_when_leak_found_(false) {
+ crash_when_leak_found_(false),
+ devtools_frontend_(NULL) {
CHECK(!instance_);
instance_ = this;
@@ -433,7 +434,9 @@ void WebKitTestController::RenderProcessGone(base::TerminationStatus status) {
void WebKitTestController::DevToolsProcessCrashed() {
DCHECK(CalledOnValidThread());
printer_->AddErrorMessage("#CRASHED - devtools");
- DiscardMainWindow();
+ if (devtools_frontend_)
+ devtools_frontend_->Close();
+ devtools_frontend_ = NULL;
}
void WebKitTestController::WebContentsDestroyed() {
@@ -586,11 +589,20 @@ void WebKitTestController::OnClearDevToolsLocalStorage() {
void WebKitTestController::OnShowDevTools(const std::string& settings,
const std::string& frontend_url) {
- main_window_->ShowDevToolsForTest(settings, frontend_url);
+ if (!devtools_frontend_) {
+ devtools_frontend_ = LayoutTestDevToolsFrontend::Show(
+ main_window_->web_contents(), settings, frontend_url);
+ } else {
+ devtools_frontend_->ReuseFrontend(
+ main_window_->web_contents(), settings, frontend_url);
+ }
+ devtools_frontend_->Activate();
+ devtools_frontend_->Focus();
}
void WebKitTestController::OnCloseDevTools() {
- main_window_->CloseDevTools();
+ if (devtools_frontend_)
+ devtools_frontend_->DisconnectFromTarget();
}
void WebKitTestController::OnGoToOffset(int offset) {
@@ -653,8 +665,10 @@ void WebKitTestController::OnCaptureSessionHistory() {
void WebKitTestController::OnCloseRemainingWindows() {
DevToolsAgentHost::DetachAllClients();
std::vector<Shell*> open_windows(Shell::windows());
+ 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_)
+ if (open_windows[i] != main_window_ && open_windows[i] != devtools_shell)
open_windows[i]->Close();
}
base::MessageLoop::current()->RunUntilIdle();
« no previous file with comments | « content/shell/browser/webkit_test_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698