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

Unified Diff: chrome/browser/devtools/devtools_window_testing.cc

Issue 1819243002: [DevTools] Use InspectorFrontendHost.readyForTest for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ready-for-test
Patch Set: resource-tree-reload.html fix Created 4 years, 9 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 | « chrome/browser/devtools/devtools_window.cc ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_window_testing.cc
diff --git a/chrome/browser/devtools/devtools_window_testing.cc b/chrome/browser/devtools/devtools_window_testing.cc
index f87939d3723f7b7d9825ac61766cb43df08311b6..6782d31c6781cbf1f8c1bde69a187d654327a0da 100644
--- a/chrome/browser/devtools/devtools_window_testing.cc
+++ b/chrome/browser/devtools/devtools_window_testing.cc
@@ -96,10 +96,12 @@ void DevToolsWindowTesting::WindowClosed(DevToolsWindow* window) {
// static
void DevToolsWindowTesting::WaitForDevToolsWindowLoad(DevToolsWindow* window) {
- scoped_refptr<content::MessageLoopRunner> runner =
- new content::MessageLoopRunner;
- window->ready_for_test_callback_ = runner->QuitClosure();
- runner->Run();
+ if (!window->ready_for_test_) {
+ scoped_refptr<content::MessageLoopRunner> runner =
+ new content::MessageLoopRunner;
+ window->ready_for_test_callback_ = runner->QuitClosure();
+ runner->Run();
+ }
base::string16 harness = base::UTF8ToUTF16(
content::DevToolsFrontendHost::GetFrontendResource(kHarnessScript));
window->main_web_contents_->GetMainFrame()->ExecuteJavaScript(harness);
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698