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

Unified Diff: content/shell/renderer/test_runner/test_interfaces.cc

Issue 446603002: Refactor code listening to platform events in content/renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webkitplatform_impl_start_stop
Patch Set: rebase Created 6 years, 4 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/renderer/test_runner/test_interfaces.h ('k') | content/shell/renderer/webkit_test_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/test_interfaces.cc
diff --git a/content/shell/renderer/test_runner/test_interfaces.cc b/content/shell/renderer/test_runner/test_interfaces.cc
index 38b675f1acef21e1fae2a736277465d9f9d1e9ac..3111dafcd82fc90de088341135af1c5bd72e6b75 100644
--- a/content/shell/renderer/test_runner/test_interfaces.cc
+++ b/content/shell/renderer/test_runner/test_interfaces.cc
@@ -26,7 +26,6 @@ namespace content {
TestInterfaces::TestInterfaces()
: accessibility_controller_(new AccessibilityController()),
event_sender_(new EventSender(this)),
- gamepad_controller_(new GamepadController()),
text_input_controller_(new TextInputController()),
test_runner_(new TestRunner(this)),
delegate_(0) {
@@ -50,7 +49,7 @@ TestInterfaces::~TestInterfaces() {
accessibility_controller_->SetDelegate(0);
event_sender_->SetDelegate(0);
- gamepad_controller_->SetDelegate(0);
+ // gamepad_controller_ ignores SetDelegate(0)
// text_input_controller_ doesn't depend on WebTestDelegate.
test_runner_->SetDelegate(0);
}
@@ -68,7 +67,7 @@ void TestInterfaces::SetWebView(blink::WebView* web_view,
void TestInterfaces::SetDelegate(WebTestDelegate* delegate) {
accessibility_controller_->SetDelegate(delegate);
event_sender_->SetDelegate(delegate);
- gamepad_controller_->SetDelegate(delegate);
+ gamepad_controller_ = GamepadController::Create(delegate);
// text_input_controller_ doesn't depend on WebTestDelegate.
test_runner_->SetDelegate(delegate);
delegate_ = delegate;
@@ -77,7 +76,8 @@ void TestInterfaces::SetDelegate(WebTestDelegate* delegate) {
void TestInterfaces::BindTo(blink::WebFrame* frame) {
accessibility_controller_->Install(frame);
event_sender_->Install(frame);
- gamepad_controller_->Install(frame);
+ if (gamepad_controller_)
+ gamepad_controller_->Install(frame);
text_input_controller_->Install(frame);
test_runner_->Install(frame);
}
@@ -85,7 +85,8 @@ void TestInterfaces::BindTo(blink::WebFrame* frame) {
void TestInterfaces::ResetTestHelperControllers() {
accessibility_controller_->Reset();
event_sender_->Reset();
- gamepad_controller_->Reset();
+ if (gamepad_controller_)
+ gamepad_controller_->Reset();
// text_input_controller_ doesn't have any state to reset.
blink::WebCache::clear();
}
« no previous file with comments | « content/shell/renderer/test_runner/test_interfaces.h ('k') | content/shell/renderer/webkit_test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698