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

Unified Diff: content/renderer/render_view_impl.cc

Issue 284583003: Use WebScreenInfo members to provide screen orientation information for layout test support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch. Created 6 years, 7 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/renderer/render_view_impl.h ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 89e077d36e3b3e61b9483d1dc37fd8cd21f33635..21425262f42c26b876eafa33aaf365cd15258931 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -4005,6 +4005,36 @@ void RenderViewImpl::SetDeviceScaleFactorForTesting(float factor) {
OnResize(params);
}
+void RenderViewImpl::SetScreenOrientationForTesting(
+ const blink::WebScreenOrientationType& orientation) {
+ ViewMsg_Resize_Params params;
+ params.screen_info = screen_info_;
+ params.screen_info.orientationType = orientation;
+ // FIXME(ostap): This relationship between orientationType and
+ // orientationAngle is temporary. The test should be able to specify
+ // the angle in addition to the orientation type.
+ switch (orientation) {
+ case blink::WebScreenOrientationLandscapePrimary:
+ params.screen_info.orientationAngle = 90;
+ break;
+ case blink::WebScreenOrientationLandscapeSecondary:
+ params.screen_info.orientationAngle = -90;
+ break;
+ case blink::WebScreenOrientationPortraitSecondary:
+ params.screen_info.orientationAngle = 180;
+ break;
+ default:
+ params.screen_info.orientationAngle = 0;
+ }
+ params.new_size = size();
+ params.physical_backing_size = gfx::ToCeiledSize(
+ gfx::ScaleSize(size(), params.screen_info.deviceScaleFactor));
+ params.overdraw_bottom_height = 0.f;
+ params.resizer_rect = WebRect();
+ params.is_fullscreen = is_fullscreen();
+ OnResize(params);
+}
+
void RenderViewImpl::SetDeviceColorProfileForTesting(
const std::vector<char>& color_profile) {
// TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile).
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698