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

Side by Side Diff: ash/display/display_util_unittest.cc

Issue 1132303005: Correctly convert warp bounds from screen to native. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added SupportsMultipleDisplays check Created 5 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 unified diff | Download patch
« no previous file with comments | « ash/display/display_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/display/display_util.h"
6
7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h"
10
11 namespace ash {
12
13 typedef test::AshTestBase DisplayUtilTest;
14
15 TEST_F(DisplayUtilTest, RotatedDisplay) {
16 if (!SupportsMultipleDisplays())
17 return;
18 {
19 UpdateDisplay("10+10-500x400,600+10-1000x600/r");
20 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
21 AshWindowTreeHost* host0 =
22 GetRootWindowController(root_windows[0])->ash_host();
23 AshWindowTreeHost* host1 =
24 GetRootWindowController(root_windows[1])->ash_host();
25 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300));
26 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300));
27 EXPECT_EQ("509,20 1x300", rect0.ToString());
28 EXPECT_EQ("1289,10 300x1", rect1.ToString());
29 }
30 {
31 UpdateDisplay("10+10-500x400,600+10-1000x600/l");
32 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
33 AshWindowTreeHost* host0 =
34 GetRootWindowController(root_windows[0])->ash_host();
35 AshWindowTreeHost* host1 =
36 GetRootWindowController(root_windows[1])->ash_host();
37 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300));
38 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300));
39 EXPECT_EQ("509,20 1x300", rect0.ToString());
40 EXPECT_EQ("610,609 300x1", rect1.ToString());
41 }
42 {
43 UpdateDisplay("10+10-500x400,600+10-1000x600/u");
44 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
45 AshWindowTreeHost* host0 =
46 GetRootWindowController(root_windows[0])->ash_host();
47 AshWindowTreeHost* host1 =
48 GetRootWindowController(root_windows[1])->ash_host();
49 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300));
50 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300));
51 EXPECT_EQ("509,20 1x300", rect0.ToString());
52 EXPECT_EQ("1599,299 1x300", rect1.ToString());
53 }
54
55 {
56 UpdateDisplay("10+10-500x400/r,600+10-1000x600");
57 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
58 AshWindowTreeHost* host0 =
59 GetRootWindowController(root_windows[0])->ash_host();
60 AshWindowTreeHost* host1 =
61 GetRootWindowController(root_windows[1])->ash_host();
62 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(399, 10, 1, 300));
63 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(400, 10, 1, 300));
64 EXPECT_EQ("199,409 300x1", rect0.ToString());
65 EXPECT_EQ("600,20 1x300", rect1.ToString());
66 }
67 {
68 UpdateDisplay("10+10-500x400/l,600+10-1000x600");
69 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
70 AshWindowTreeHost* host0 =
71 GetRootWindowController(root_windows[0])->ash_host();
72 AshWindowTreeHost* host1 =
73 GetRootWindowController(root_windows[1])->ash_host();
74 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300));
75 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300));
76 EXPECT_EQ("20,10 300x1", rect0.ToString());
77 EXPECT_EQ("600,20 1x300", rect1.ToString());
78 }
79 {
80 UpdateDisplay("10+10-500x400/u,600+10-1000x600");
81 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
82 AshWindowTreeHost* host0 =
83 GetRootWindowController(root_windows[0])->ash_host();
84 AshWindowTreeHost* host1 =
85 GetRootWindowController(root_windows[1])->ash_host();
86 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300));
87 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300));
88 EXPECT_EQ("10,99 1x300", rect0.ToString());
89 EXPECT_EQ("600,20 1x300", rect1.ToString());
90 }
91 }
92
93 } // namespace
OLDNEW
« no previous file with comments | « ash/display/display_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698