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

Unified Diff: ash/display/display_util_unittest.cc

Issue 2286523002: Relocate reuseable portions of ash/display/display_util.* (Closed)
Patch Set: fixed ozone build Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_util.cc ('k') | ash/display/extended_mouse_warp_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_util_unittest.cc
diff --git a/ash/display/display_util_unittest.cc b/ash/display/display_util_unittest.cc
index 2e70a1b4ce9b0116aa4a9fa239f195b4705782ff..ca58a9c333ea8bafc8b70e5d9a22960be4fedebd 100644
--- a/ash/display/display_util_unittest.cc
+++ b/ash/display/display_util_unittest.cc
@@ -91,88 +91,4 @@ TEST_F(DisplayUtilTest, RotatedDisplay) {
}
}
-TEST_F(DisplayUtilTest, GenerateDisplayIdList) {
- display::DisplayIdList list;
- {
- int64_t ids[] = {10, 1};
- list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ(1, list[0]);
- EXPECT_EQ(10, list[1]);
-
- int64_t three_ids[] = {10, 5, 1};
- list = GenerateDisplayIdList(std::begin(three_ids), std::end(three_ids));
- ASSERT_EQ(3u, list.size());
- EXPECT_EQ(1, list[0]);
- EXPECT_EQ(5, list[1]);
- EXPECT_EQ(10, list[2]);
- }
- {
- int64_t ids[] = {10, 100};
- list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ(10, list[0]);
- EXPECT_EQ(100, list[1]);
-
- int64_t three_ids[] = {10, 100, 1000};
- list = GenerateDisplayIdList(std::begin(three_ids), std::end(three_ids));
- ASSERT_EQ(3u, list.size());
- EXPECT_EQ(10, list[0]);
- EXPECT_EQ(100, list[1]);
- EXPECT_EQ(1000, list[2]);
- }
- {
- test::ScopedSetInternalDisplayId set_internal(100);
- int64_t ids[] = {10, 100};
- list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ(100, list[0]);
- EXPECT_EQ(10, list[1]);
-
- std::swap(ids[0], ids[1]);
- list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ(100, list[0]);
- EXPECT_EQ(10, list[1]);
-
- int64_t three_ids[] = {10, 100, 1000};
- list = GenerateDisplayIdList(std::begin(three_ids), std::end(three_ids));
- ASSERT_EQ(3u, list.size());
- EXPECT_EQ(100, list[0]);
- EXPECT_EQ(10, list[1]);
- EXPECT_EQ(1000, list[2]);
- }
- {
- test::ScopedSetInternalDisplayId set_internal(10);
- int64_t ids[] = {10, 100};
- list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ(10, list[0]);
- EXPECT_EQ(100, list[1]);
-
- std::swap(ids[0], ids[1]);
- list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ(10, list[0]);
- EXPECT_EQ(100, list[1]);
-
- int64_t three_ids[] = {10, 100, 1000};
- list = GenerateDisplayIdList(std::begin(three_ids), std::end(three_ids));
- ASSERT_EQ(3u, list.size());
- EXPECT_EQ(10, list[0]);
- EXPECT_EQ(100, list[1]);
- EXPECT_EQ(1000, list[2]);
- }
-}
-
-TEST_F(DisplayUtilTest, DisplayIdListToString) {
- {
- int64_t ids[] = {10, 1, 16};
- display::DisplayIdList list =
- GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ("1,10,16", DisplayIdListToString(list));
- }
- {
- test::ScopedSetInternalDisplayId set_internal(16);
- int64_t ids[] = {10, 1, 16};
- display::DisplayIdList list =
- GenerateDisplayIdList(std::begin(ids), std::end(ids));
- EXPECT_EQ("16,1,10", DisplayIdListToString(list));
- }
-}
-
-} // namespace
+} // namespace ash
« no previous file with comments | « ash/display/display_util.cc ('k') | ash/display/extended_mouse_warp_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698