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

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

Issue 1722643003: Reland of [DevTools] Move screen orientation override to RenderWidgetScreenMetricsEmulator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 new LayoutAndPaintCallback(callback); 585 new LayoutAndPaintCallback(callback);
586 web_widget_->layoutAndPaintAsync(layout_and_paint_callback); 586 web_widget_->layoutAndPaintAsync(layout_and_paint_callback);
587 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) { 587 if (blink::WebPagePopup* popup = web_widget_->pagePopup()) {
588 layout_and_paint_callback->set_wait_for_popup(true); 588 layout_and_paint_callback->set_wait_for_popup(true);
589 popup->layoutAndPaintAsync(layout_and_paint_callback); 589 popup->layoutAndPaintAsync(layout_and_paint_callback);
590 } 590 }
591 } 591 }
592 592
593 void WebTestProxyBase::GetScreenOrientationForTesting( 593 void WebTestProxyBase::GetScreenOrientationForTesting(
594 blink::WebScreenInfo& screen_info) { 594 blink::WebScreenInfo& screen_info) {
595 if (!screen_orientation_client_) 595 if (!screen_orientation_client_ || !screen_orientation_client_->is_active())
596 return; 596 return;
597 // Override screen orientation information with mock data. 597 // Override screen orientation information with mock data.
598 screen_info.orientationType = 598 screen_info.orientationType =
599 screen_orientation_client_->CurrentOrientationType(); 599 screen_orientation_client_->CurrentOrientationType();
600 screen_info.orientationAngle = 600 screen_info.orientationAngle =
601 screen_orientation_client_->CurrentOrientationAngle(); 601 screen_orientation_client_->CurrentOrientationAngle();
602 } 602 }
603 603
604 MockScreenOrientationClient* 604 MockScreenOrientationClient*
605 WebTestProxyBase::GetScreenOrientationClientMock() { 605 WebTestProxyBase::GetScreenOrientationClientMock() {
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 callback->onError(blink::WebSetSinkIdError::NotAuthorized); 1296 callback->onError(blink::WebSetSinkIdError::NotAuthorized);
1297 else 1297 else
1298 callback->onError(blink::WebSetSinkIdError::NotFound); 1298 callback->onError(blink::WebSetSinkIdError::NotFound);
1299 } 1299 }
1300 1300
1301 blink::WebString WebTestProxyBase::acceptLanguages() { 1301 blink::WebString WebTestProxyBase::acceptLanguages() {
1302 return blink::WebString::fromUTF8(accept_languages_); 1302 return blink::WebString::fromUTF8(accept_languages_);
1303 } 1303 }
1304 1304
1305 } // namespace test_runner 1305 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698