Index: components/test_runner/web_test_proxy.cc |
diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc |
index 2db9db404915ba7294af2f13e4c9b7e383f282fd..0f181e584eaca7b7399dc1366d10aa363a1226ba 100644 |
--- a/components/test_runner/web_test_proxy.cc |
+++ b/components/test_runner/web_test_proxy.cc |
@@ -608,21 +608,17 @@ void WebTestProxyBase::LayoutAndPaintAsyncThen(const base::Closure& callback) { |
void WebTestProxyBase::GetScreenOrientationForTesting( |
blink::WebScreenInfo& screen_info) { |
- if (!screen_orientation_client_ || screen_orientation_client_->IsDisabled()) |
+ MockScreenOrientationClient* mock_client = GetScreenOrientationClientMock(); |
+ if (mock_client->IsDisabled()) |
Łukasz Anforowicz
2016/03/16 00:16:01
This is a slightly different condition than before
|
return; |
// Override screen orientation information with mock data. |
- screen_info.orientationType = |
- screen_orientation_client_->CurrentOrientationType(); |
- screen_info.orientationAngle = |
- screen_orientation_client_->CurrentOrientationAngle(); |
+ screen_info.orientationType = mock_client->CurrentOrientationType(); |
+ screen_info.orientationAngle = mock_client->CurrentOrientationAngle(); |
} |
MockScreenOrientationClient* |
WebTestProxyBase::GetScreenOrientationClientMock() { |
- if (!screen_orientation_client_.get()) { |
- screen_orientation_client_.reset(new MockScreenOrientationClient); |
- } |
- return screen_orientation_client_.get(); |
+ return test_interfaces_->GetTestRunner()->getMockScreenOrientationClient(); |
} |
MockWebSpeechRecognizer* WebTestProxyBase::GetSpeechRecognizerMock() { |