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

Side by Side Diff: ui/display/manager/display_manager_utilities_unittest.cc

Issue 2519993002: Move kInvalidDisplayID to display_constants.h. (Closed)
Patch Set: Add comment. Created 4 years, 1 month 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"
sadrul 2016/11/21 17:31:17 Remove this too?
kylechar 2016/11/21 17:51:18 Done.
6 6
7 #include "ui/display/manager/display_manager_utilities.h" 7 #include "ui/display/manager/display_manager_utilities.h"
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10 #include "ui/display/display.h"
11 //#include "ash/root_window_controller.h" 11 #include "ui/display/types/display_constants.h"
12 //#include "ash/shell.h"
13 //#include "ash/test/ash_test_base.h"
14 //#include "ash/test/display_manager_test_api.h"
15 12
16 namespace display { 13 namespace display {
17 14
18 // typedef test::AshTestBase DisplayUtilTest;
19
20 namespace { 15 namespace {
21 16
22 class ScopedSetInternalDisplayId { 17 class ScopedSetInternalDisplayId {
23 public: 18 public:
24 ScopedSetInternalDisplayId(int64_t); 19 ScopedSetInternalDisplayId(int64_t);
25 ~ScopedSetInternalDisplayId(); 20 ~ScopedSetInternalDisplayId();
26 }; 21 };
27 22
28 ScopedSetInternalDisplayId::ScopedSetInternalDisplayId(int64_t id) { 23 ScopedSetInternalDisplayId::ScopedSetInternalDisplayId(int64_t id) {
29 display::Display::SetInternalDisplayId(id); 24 display::Display::SetInternalDisplayId(id);
30 } 25 }
31 26
32 ScopedSetInternalDisplayId::~ScopedSetInternalDisplayId() { 27 ScopedSetInternalDisplayId::~ScopedSetInternalDisplayId() {
33 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID); 28 display::Display::SetInternalDisplayId(kInvalidDisplayID);
34 } 29 }
35 30
36 } // namespace 31 } // namespace
37 32
38 TEST(DisplayUtilitiesTest, GenerateDisplayIdList) { 33 TEST(DisplayUtilitiesTest, GenerateDisplayIdList) {
39 display::DisplayIdList list; 34 display::DisplayIdList list;
40 { 35 {
41 int64_t ids[] = {10, 1}; 36 int64_t ids[] = {10, 1};
42 list = GenerateDisplayIdList(std::begin(ids), std::end(ids)); 37 list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
43 EXPECT_EQ(1, list[0]); 38 EXPECT_EQ(1, list[0]);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 { 108 {
114 ScopedSetInternalDisplayId set_internal(16); 109 ScopedSetInternalDisplayId set_internal(16);
115 int64_t ids[] = {10, 1, 16}; 110 int64_t ids[] = {10, 1, 16};
116 display::DisplayIdList list = 111 display::DisplayIdList list =
117 GenerateDisplayIdList(std::begin(ids), std::end(ids)); 112 GenerateDisplayIdList(std::begin(ids), std::end(ids));
118 EXPECT_EQ("16,1,10", DisplayIdListToString(list)); 113 EXPECT_EQ("16,1,10", DisplayIdListToString(list));
119 } 114 }
120 } 115 }
121 116
122 } // namespace display 117 } // namespace display
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698