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

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

Issue 1638413007: Use list instead of pair to represent the set of displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build error Created 4 years, 10 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 "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, CreateDisplayIdPair) { 94 TEST_F(DisplayUtilTest, CreateDisplayIdPair) {
95 DisplayIdPair pair = CreateDisplayIdPair(10, 1); 95 DisplayIdList list = CreateDisplayIdList(10, 1);
96 EXPECT_EQ(1, pair.first); 96 EXPECT_EQ(1, list[0]);
97 EXPECT_EQ(10, pair.second); 97 EXPECT_EQ(10, list[1]);
98 pair = CreateDisplayIdPair(10, 100); 98 list = CreateDisplayIdList(10, 100);
99 EXPECT_EQ(10, pair.first); 99 EXPECT_EQ(10, list[0]);
100 EXPECT_EQ(100, pair.second); 100 EXPECT_EQ(100, list[1]);
101 { 101 {
102 test::ScopedSetInternalDisplayId set_internal(100); 102 test::ScopedSetInternalDisplayId set_internal(100);
103 pair = CreateDisplayIdPair(10, 100); 103 list = CreateDisplayIdList(10, 100);
104 EXPECT_EQ(100, pair.first); 104 EXPECT_EQ(100, list[0]);
105 EXPECT_EQ(10, pair.second); 105 EXPECT_EQ(10, list[1]);
106 106
107 pair = CreateDisplayIdPair(100, 10); 107 list = CreateDisplayIdList(100, 10);
108 EXPECT_EQ(100, pair.first); 108 EXPECT_EQ(100, list[0]);
109 EXPECT_EQ(10, pair.second); 109 EXPECT_EQ(10, list[1]);
110 } 110 }
111 111
112 { 112 {
113 test::ScopedSetInternalDisplayId set_internal(10); 113 test::ScopedSetInternalDisplayId set_internal(10);
114 pair = CreateDisplayIdPair(10, 100); 114 list = CreateDisplayIdList(10, 100);
115 EXPECT_EQ(10, pair.first); 115 EXPECT_EQ(10, list[0]);
116 EXPECT_EQ(100, pair.second); 116 EXPECT_EQ(100, list[1]);
117 117
118 pair = CreateDisplayIdPair(100, 10); 118 list = CreateDisplayIdList(100, 10);
119 EXPECT_EQ(10, pair.first); 119 EXPECT_EQ(10, list[0]);
120 EXPECT_EQ(100, pair.second); 120 EXPECT_EQ(100, list[1]);
121 } 121 }
122 } 122 }
123 123
124 } // namespace 124 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698