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

Unified Diff: components/test_runner/test_interfaces.cc

Issue 1896623002: Setting TestRunner's main window from BlinkTestRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replicate-across-all-renderers
Patch Set: Rebasing... Created 4 years, 8 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 | « components/test_runner/test_interfaces.h ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/test_interfaces.cc
diff --git a/components/test_runner/test_interfaces.cc b/components/test_runner/test_interfaces.cc
index c33fa36f924eef94fb3ac10ffc33d6ed89eccd7f..1571b042ce9956a8d1b53be83827f31b0a3145ca 100644
--- a/components/test_runner/test_interfaces.cc
+++ b/components/test_runner/test_interfaces.cc
@@ -29,7 +29,8 @@ namespace test_runner {
TestInterfaces::TestInterfaces()
: test_runner_(new TestRunner(this)),
delegate_(nullptr),
- app_banner_client_(nullptr) {
+ app_banner_client_(nullptr),
+ main_view_(nullptr) {
blink::setLayoutTestMode(true);
// NOTE: please don't put feature specific enable flags here,
// instead add them to RuntimeEnabledFeatures.in
@@ -39,16 +40,16 @@ TestInterfaces::TestInterfaces()
TestInterfaces::~TestInterfaces() {
// gamepad_controller_ doesn't depend on WebView.
- test_runner_->SetWebView(nullptr);
+ test_runner_->SetMainView(nullptr);
// gamepad_controller_ ignores SetDelegate(nullptr)
test_runner_->SetDelegate(nullptr);
}
-void TestInterfaces::SetWebView(blink::WebView* web_view,
- WebTestProxyBase* proxy) {
+void TestInterfaces::SetMainView(blink::WebView* web_view) {
// gamepad_controller_ doesn't depend on WebView.
- test_runner_->SetWebView(web_view);
+ main_view_ = web_view;
+ test_runner_->SetMainView(web_view);
}
void TestInterfaces::SetDelegate(WebTestDelegate* delegate) {
@@ -129,6 +130,9 @@ void TestInterfaces::WindowClosed(WebTestProxyBase* proxy) {
return;
}
window_list_.erase(pos);
+
+ if (proxy->web_view() == main_view_)
+ SetMainView(nullptr);
}
TestRunner* TestInterfaces::GetTestRunner() {
« no previous file with comments | « components/test_runner/test_interfaces.h ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698