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

Side by Side Diff: components/test_runner/web_test_proxy.cc

Issue 1807733002: Make MockScreenOrientationClient an internal detail of components/test_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-app-banner-dep
Patch Set: Rebasing... 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 unified diff | Download patch
OLDNEW
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/web_test_proxy.h" 5 #include "components/test_runner/web_test_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cctype> 10 #include <cctype>
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 new LayoutAndPaintCallback(callback); 601 new LayoutAndPaintCallback(callback);
602 web_widget_->layoutAndPaintAsync(layout_and_paint_callback); 602 web_widget_->layoutAndPaintAsync(layout_and_paint_callback);
603 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { 603 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) {
604 layout_and_paint_callback->set_wait_for_popup(true); 604 layout_and_paint_callback->set_wait_for_popup(true);
605 popup->layoutAndPaintAsync(layout_and_paint_callback); 605 popup->layoutAndPaintAsync(layout_and_paint_callback);
606 } 606 }
607 } 607 }
608 608
609 void WebTestProxyBase::GetScreenOrientationForTesting( 609 void WebTestProxyBase::GetScreenOrientationForTesting(
610 blink::WebScreenInfo& screen_info) { 610 blink::WebScreenInfo& screen_info) {
611 if (!screen_orientation_client_ || screen_orientation_client_->IsDisabled()) 611 MockScreenOrientationClient* mock_client = GetScreenOrientationClientMock();
612 if (mock_client->IsDisabled())
Łukasz Anforowicz 2016/03/16 00:16:01 This is a slightly different condition than before
612 return; 613 return;
613 // Override screen orientation information with mock data. 614 // Override screen orientation information with mock data.
614 screen_info.orientationType = 615 screen_info.orientationType = mock_client->CurrentOrientationType();
615 screen_orientation_client_->CurrentOrientationType(); 616 screen_info.orientationAngle = mock_client->CurrentOrientationAngle();
616 screen_info.orientationAngle =
617 screen_orientation_client_->CurrentOrientationAngle();
618 } 617 }
619 618
620 MockScreenOrientationClient* 619 MockScreenOrientationClient*
621 WebTestProxyBase::GetScreenOrientationClientMock() { 620 WebTestProxyBase::GetScreenOrientationClientMock() {
622 if (!screen_orientation_client_.get()) { 621 return test_interfaces_->GetTestRunner()->getMockScreenOrientationClient();
623 screen_orientation_client_.reset(new MockScreenOrientationClient);
624 }
625 return screen_orientation_client_.get();
626 } 622 }
627 623
628 MockWebSpeechRecognizer* WebTestProxyBase::GetSpeechRecognizerMock() { 624 MockWebSpeechRecognizer* WebTestProxyBase::GetSpeechRecognizerMock() {
629 if (!speech_recognizer_.get()) { 625 if (!speech_recognizer_.get()) {
630 speech_recognizer_.reset(new MockWebSpeechRecognizer()); 626 speech_recognizer_.reset(new MockWebSpeechRecognizer());
631 speech_recognizer_->SetDelegate(delegate_); 627 speech_recognizer_->SetDelegate(delegate_);
632 } 628 }
633 return speech_recognizer_.get(); 629 return speech_recognizer_.get();
634 } 630 }
635 631
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 callback->onError(blink::WebSetSinkIdError::NotAuthorized); 1308 callback->onError(blink::WebSetSinkIdError::NotAuthorized);
1313 else 1309 else
1314 callback->onError(blink::WebSetSinkIdError::NotFound); 1310 callback->onError(blink::WebSetSinkIdError::NotFound);
1315 } 1311 }
1316 1312
1317 blink::WebString WebTestProxyBase::acceptLanguages() { 1313 blink::WebString WebTestProxyBase::acceptLanguages() {
1318 return blink::WebString::fromUTF8(accept_languages_); 1314 return blink::WebString::fromUTF8(accept_languages_);
1319 } 1315 }
1320 1316
1321 } // namespace test_runner 1317 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698