| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |