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

Side by Side Diff: content/browser/screen_orientation/screen_orientation_browsertest.cc

Issue 2317563004: Change blink::WebScreenInfo to content::ScreenInfo (Closed)
Patch Set: Fix Windows compile Created 4 years, 3 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
11 #include "content/common/view_messages.h" 11 #include "content/common/view_messages.h"
12 #include "content/public/browser/render_widget_host.h" 12 #include "content/public/browser/render_widget_host.h"
13 #include "content/public/browser/render_widget_host_view.h" 13 #include "content/public/browser/render_widget_host_view.h"
14 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "content/public/test/browser_test_utils.h" 16 #include "content/public/test/browser_test_utils.h"
17 #include "content/public/test/content_browser_test.h" 17 #include "content/public/test/content_browser_test.h"
18 #include "content/public/test/content_browser_test_utils.h" 18 #include "content/public/test/content_browser_test_utils.h"
19 #include "content/public/test/test_navigation_observer.h" 19 #include "content/public/test/test_navigation_observer.h"
20 #include "content/public/test/test_utils.h" 20 #include "content/public/test/test_utils.h"
21 #include "content/shell/browser/shell.h" 21 #include "content/shell/browser/shell.h"
22 #include "content/shell/common/shell_switches.h" 22 #include "content/shell/common/shell_switches.h"
23 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
24 #include "ui/compositor/compositor_switches.h" 23 #include "ui/compositor/compositor_switches.h"
25 24
26 namespace content { 25 namespace content {
27 26
28 class ScreenOrientationBrowserTest : public ContentBrowserTest { 27 class ScreenOrientationBrowserTest : public ContentBrowserTest {
29 public: 28 public:
30 ScreenOrientationBrowserTest() { 29 ScreenOrientationBrowserTest() {
31 } 30 }
32 31
33 protected: 32 protected:
34 void SendFakeScreenOrientation(unsigned angle, const std::string& strType) { 33 void SendFakeScreenOrientation(unsigned angle, const std::string& strType) {
35 RenderWidgetHost* rwh = shell()->web_contents()->GetRenderWidgetHostView() 34 RenderWidgetHost* rwh = shell()->web_contents()->GetRenderWidgetHostView()
36 ->GetRenderWidgetHost(); 35 ->GetRenderWidgetHost();
37 blink::WebScreenInfo screen_info; 36 ScreenInfo screen_info;
38 rwh->GetWebScreenInfo(&screen_info); 37 rwh->GetScreenInfo(&screen_info);
39 screen_info.orientationAngle = angle; 38 screen_info.orientation_angle = angle;
40 39
41 blink::WebScreenOrientationType type = blink::WebScreenOrientationUndefined; 40 ScreenOrientationValues type = SCREEN_ORIENTATION_VALUES_DEFAULT;
42 if (strType == "portrait-primary") { 41 if (strType == "portrait-primary") {
43 type = blink::WebScreenOrientationPortraitPrimary; 42 type = SCREEN_ORIENTATION_VALUES_PORTRAIT_PRIMARY;
44 } else if (strType == "portrait-secondary") { 43 } else if (strType == "portrait-secondary") {
45 type = blink::WebScreenOrientationPortraitSecondary; 44 type = SCREEN_ORIENTATION_VALUES_PORTRAIT_SECONDARY;
46 } else if (strType == "landscape-primary") { 45 } else if (strType == "landscape-primary") {
47 type = blink::WebScreenOrientationLandscapePrimary; 46 type = SCREEN_ORIENTATION_VALUES_LANDSCAPE_PRIMARY;
48 } else if (strType == "landscape-secondary") { 47 } else if (strType == "landscape-secondary") {
49 type = blink::WebScreenOrientationLandscapeSecondary; 48 type = SCREEN_ORIENTATION_VALUES_LANDSCAPE_SECONDARY;
50 } 49 }
51 ASSERT_NE(blink::WebScreenOrientationUndefined, type); 50 ASSERT_NE(SCREEN_ORIENTATION_VALUES_DEFAULT, type);
52 screen_info.orientationType = type; 51 screen_info.orientation_type = type;
53 52
54 ResizeParams params; 53 ResizeParams params;
55 params.screen_info = screen_info; 54 params.screen_info = screen_info;
56 params.new_size = gfx::Size(0, 0); 55 params.new_size = gfx::Size(0, 0);
57 params.physical_backing_size = gfx::Size(300, 300); 56 params.physical_backing_size = gfx::Size(300, 300);
58 params.top_controls_height = 0.f; 57 params.top_controls_height = 0.f;
59 params.top_controls_shrink_blink_size = false; 58 params.top_controls_shrink_blink_size = false;
60 params.resizer_rect = gfx::Rect(); 59 params.resizer_rect = gfx::Rect();
61 params.is_fullscreen_granted = false; 60 params.is_fullscreen_granted = false;
62 rwh->Send(new ViewMsg_Resize(rwh->GetRoutingID(), params)); 61 rwh->Send(new ViewMsg_Resize(rwh->GetRoutingID(), params));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 240
242 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); 241 TestNavigationObserver navigation_observer(shell()->web_contents(), 1);
243 navigation_observer.Wait(); 242 navigation_observer.Wait();
244 EXPECT_EQ("NotSupportedError", 243 EXPECT_EQ("NotSupportedError",
245 shell()->web_contents()->GetLastCommittedURL().ref()); 244 shell()->web_contents()->GetLastCommittedURL().ref());
246 } 245 }
247 } 246 }
248 #endif // defined(OS_ANDROID) 247 #endif // defined(OS_ANDROID)
249 248
250 } // namespace content 249 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698