| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/test_runner/test_interfaces.h" | 5 #include "components/test_runner/test_interfaces.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 delegate_(nullptr), | 36 delegate_(nullptr), |
| 37 app_banner_client_(nullptr) { | 37 app_banner_client_(nullptr) { |
| 38 blink::setLayoutTestMode(true); | 38 blink::setLayoutTestMode(true); |
| 39 // NOTE: please don't put feature specific enable flags here, | 39 // NOTE: please don't put feature specific enable flags here, |
| 40 // instead add them to RuntimeEnabledFeatures.in | 40 // instead add them to RuntimeEnabledFeatures.in |
| 41 | 41 |
| 42 ResetAll(); | 42 ResetAll(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 TestInterfaces::~TestInterfaces() { | 45 TestInterfaces::~TestInterfaces() { |
| 46 accessibility_controller_->SetWebView(0); | 46 accessibility_controller_->SetWebView(nullptr); |
| 47 event_sender_->SetWebView(0); | 47 event_sender_->SetWebView(nullptr); |
| 48 // gamepad_controller_ doesn't depend on WebView. | 48 // gamepad_controller_ doesn't depend on WebView. |
| 49 text_input_controller_->SetWebView(NULL); | 49 text_input_controller_->SetWebView(nullptr); |
| 50 test_runner_->SetWebView(0, 0); | 50 test_runner_->SetWebView(nullptr); |
| 51 | 51 |
| 52 accessibility_controller_->SetDelegate(0); | 52 accessibility_controller_->SetDelegate(nullptr); |
| 53 event_sender_->SetDelegate(0); | 53 event_sender_->SetDelegate(nullptr); |
| 54 // gamepad_controller_ ignores SetDelegate(0) | 54 // gamepad_controller_ ignores SetDelegate(nullptr) |
| 55 // text_input_controller_ doesn't depend on WebTestDelegate. | 55 // text_input_controller_ doesn't depend on WebTestDelegate. |
| 56 test_runner_->SetDelegate(0); | 56 test_runner_->SetDelegate(nullptr); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void TestInterfaces::SetWebView(blink::WebView* web_view, | 59 void TestInterfaces::SetWebView(blink::WebView* web_view, |
| 60 WebTestProxyBase* proxy) { | 60 WebTestProxyBase* proxy) { |
| 61 accessibility_controller_->SetWebView(web_view); | 61 accessibility_controller_->SetWebView(web_view); |
| 62 event_sender_->SetWebView(web_view); | 62 event_sender_->SetWebView(web_view); |
| 63 // gamepad_controller_ doesn't depend on WebView. | 63 // gamepad_controller_ doesn't depend on WebView. |
| 64 text_input_controller_->SetWebView(web_view); | 64 text_input_controller_->SetWebView(web_view); |
| 65 test_runner_->SetWebView(web_view, proxy); | 65 test_runner_->SetWebView(web_view); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void TestInterfaces::SetDelegate(WebTestDelegate* delegate) { | 68 void TestInterfaces::SetDelegate(WebTestDelegate* delegate) { |
| 69 accessibility_controller_->SetDelegate(delegate); | 69 accessibility_controller_->SetDelegate(delegate); |
| 70 event_sender_->SetDelegate(delegate); | 70 event_sender_->SetDelegate(delegate); |
| 71 gamepad_controller_ = GamepadController::Create(delegate); | 71 gamepad_controller_ = GamepadController::Create(delegate); |
| 72 // text_input_controller_ doesn't depend on WebTestDelegate. | 72 // text_input_controller_ doesn't depend on WebTestDelegate. |
| 73 test_runner_->SetDelegate(delegate); | 73 test_runner_->SetDelegate(delegate); |
| 74 delegate_ = delegate; | 74 delegate_ = delegate; |
| 75 } | 75 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 if (!theme_engine_.get()) | 178 if (!theme_engine_.get()) |
| 179 theme_engine_.reset(new MockWebThemeEngine()); | 179 theme_engine_.reset(new MockWebThemeEngine()); |
| 180 return theme_engine_.get(); | 180 return theme_engine_.get(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 AppBannerClient* TestInterfaces::GetAppBannerClient() { | 183 AppBannerClient* TestInterfaces::GetAppBannerClient() { |
| 184 return app_banner_client_; | 184 return app_banner_client_; |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace test_runner | 187 } // namespace test_runner |
| OLD | NEW |