OLD | NEW |
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 "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/browser/render_widget_host.h" | 10 #include "content/public/browser/render_widget_host.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
26 #endif // OS_WIN | 26 #endif // OS_WIN |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 class ScreenOrientationBrowserTest : public ContentBrowserTest { | 30 class ScreenOrientationBrowserTest : public ContentBrowserTest { |
31 public: | 31 public: |
32 ScreenOrientationBrowserTest() { | 32 ScreenOrientationBrowserTest() { |
33 } | 33 } |
34 | 34 |
35 void SetUp() override { | |
36 // Painting has to happen otherwise the Resize messages will be added on top | |
37 // of each other without properly ack-painting which will fail and crash. | |
38 UseSoftwareCompositing(); | |
39 | |
40 ContentBrowserTest::SetUp(); | |
41 } | |
42 | |
43 protected: | 35 protected: |
44 void SendFakeScreenOrientation(unsigned angle, const std::string& strType) { | 36 void SendFakeScreenOrientation(unsigned angle, const std::string& strType) { |
45 RenderWidgetHost* rwh = shell()->web_contents()->GetRenderWidgetHostView() | 37 RenderWidgetHost* rwh = shell()->web_contents()->GetRenderWidgetHostView() |
46 ->GetRenderWidgetHost(); | 38 ->GetRenderWidgetHost(); |
47 blink::WebScreenInfo screen_info; | 39 blink::WebScreenInfo screen_info; |
48 rwh->GetWebScreenInfo(&screen_info); | 40 rwh->GetWebScreenInfo(&screen_info); |
49 screen_info.orientationAngle = angle; | 41 screen_info.orientationAngle = angle; |
50 | 42 |
51 blink::WebScreenOrientationType type = blink::WebScreenOrientationUndefined; | 43 blink::WebScreenOrientationType type = blink::WebScreenOrientationUndefined; |
52 if (strType == "portrait-primary") { | 44 if (strType == "portrait-primary") { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 225 } |
234 #endif // defined(OS_WIN) | 226 #endif // defined(OS_WIN) |
235 | 227 |
236 navigation_observer.Wait(); | 228 navigation_observer.Wait(); |
237 | 229 |
238 // This is a success if the renderer process did not crash, thus, we end up | 230 // This is a success if the renderer process did not crash, thus, we end up |
239 // here. | 231 // here. |
240 } | 232 } |
241 | 233 |
242 } // namespace content | 234 } // namespace content |
OLD | NEW |