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

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

Issue 1838833002: Move DisplayLayout and DisplayLayoutBuilder From ash To ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screenwinmove
Patch Set: Fix comment Created 4 years, 8 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') | ash/display/extended_mouse_warp_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/display/display_util.h" 5 #include "ash/display/display_util.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/test/display_manager_test_api.h" 10 #include "ash/test/display_manager_test_api.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 AshWindowTreeHost* host1 = 85 AshWindowTreeHost* host1 =
86 GetRootWindowController(root_windows[1])->ash_host(); 86 GetRootWindowController(root_windows[1])->ash_host();
87 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300)); 87 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300));
88 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300)); 88 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300));
89 EXPECT_EQ("10,99 1x300", rect0.ToString()); 89 EXPECT_EQ("10,99 1x300", rect0.ToString());
90 EXPECT_EQ("600,20 1x300", rect1.ToString()); 90 EXPECT_EQ("600,20 1x300", rect1.ToString());
91 } 91 }
92 } 92 }
93 93
94 TEST_F(DisplayUtilTest, GenerateDisplayIdList) { 94 TEST_F(DisplayUtilTest, GenerateDisplayIdList) {
95 DisplayIdList list; 95 display::DisplayIdList list;
96 { 96 {
97 int64_t ids[] = {10, 1}; 97 int64_t ids[] = {10, 1};
98 list = GenerateDisplayIdList(std::begin(ids), std::end(ids)); 98 list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
99 EXPECT_EQ(1, list[0]); 99 EXPECT_EQ(1, list[0]);
100 EXPECT_EQ(10, list[1]); 100 EXPECT_EQ(10, list[1]);
101 101
102 int64_t three_ids[] = {10, 5, 1}; 102 int64_t three_ids[] = {10, 5, 1};
103 list = GenerateDisplayIdList(std::begin(three_ids), std::end(three_ids)); 103 list = GenerateDisplayIdList(std::begin(three_ids), std::end(three_ids));
104 ASSERT_EQ(3u, list.size()); 104 ASSERT_EQ(3u, list.size());
105 EXPECT_EQ(1, list[0]); 105 EXPECT_EQ(1, list[0]);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ASSERT_EQ(3u, list.size()); 155 ASSERT_EQ(3u, list.size());
156 EXPECT_EQ(10, list[0]); 156 EXPECT_EQ(10, list[0]);
157 EXPECT_EQ(100, list[1]); 157 EXPECT_EQ(100, list[1]);
158 EXPECT_EQ(1000, list[2]); 158 EXPECT_EQ(1000, list[2]);
159 } 159 }
160 } 160 }
161 161
162 TEST_F(DisplayUtilTest, DisplayIdListToString) { 162 TEST_F(DisplayUtilTest, DisplayIdListToString) {
163 { 163 {
164 int64_t ids[] = {10, 1, 16}; 164 int64_t ids[] = {10, 1, 16};
165 DisplayIdList list = GenerateDisplayIdList(std::begin(ids), std::end(ids)); 165 display::DisplayIdList list =
166 GenerateDisplayIdList(std::begin(ids), std::end(ids));
166 EXPECT_EQ("1,10,16", DisplayIdListToString(list)); 167 EXPECT_EQ("1,10,16", DisplayIdListToString(list));
167 } 168 }
168 { 169 {
169 test::ScopedSetInternalDisplayId set_internal(16); 170 test::ScopedSetInternalDisplayId set_internal(16);
170 int64_t ids[] = {10, 1, 16}; 171 int64_t ids[] = {10, 1, 16};
171 DisplayIdList list = GenerateDisplayIdList(std::begin(ids), std::end(ids)); 172 display::DisplayIdList list =
173 GenerateDisplayIdList(std::begin(ids), std::end(ids));
172 EXPECT_EQ("16,1,10", DisplayIdListToString(list)); 174 EXPECT_EQ("16,1,10", DisplayIdListToString(list));
173 } 175 }
174 } 176 }
175 177
176 } // namespace 178 } // namespace
OLDNEW
« no previous file with comments | « ash/display/display_util.cc ('k') | ash/display/extended_mouse_warp_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698