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

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

Issue 2519993002: Move kInvalidDisplayID to display_constants.h. (Closed)
Patch Set: Address comments. 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
« no previous file with comments | « ui/display/manager/display_manager.cc ('k') | ui/display/manager/managed_display_info.cc » ('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"
6
7 #include "ui/display/manager/display_manager_utilities.h" 5 #include "ui/display/manager/display_manager_utilities.h"
8 6
9 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
10 8 #include "ui/display/display.h"
11 //#include "ash/root_window_controller.h" 9 #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 10
16 namespace display { 11 namespace display {
17 12
18 // typedef test::AshTestBase DisplayUtilTest;
19
20 namespace { 13 namespace {
21 14
22 class ScopedSetInternalDisplayId { 15 class ScopedSetInternalDisplayId {
23 public: 16 public:
24 ScopedSetInternalDisplayId(int64_t); 17 ScopedSetInternalDisplayId(int64_t);
25 ~ScopedSetInternalDisplayId(); 18 ~ScopedSetInternalDisplayId();
26 }; 19 };
27 20
28 ScopedSetInternalDisplayId::ScopedSetInternalDisplayId(int64_t id) { 21 ScopedSetInternalDisplayId::ScopedSetInternalDisplayId(int64_t id) {
29 display::Display::SetInternalDisplayId(id); 22 display::Display::SetInternalDisplayId(id);
30 } 23 }
31 24
32 ScopedSetInternalDisplayId::~ScopedSetInternalDisplayId() { 25 ScopedSetInternalDisplayId::~ScopedSetInternalDisplayId() {
33 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID); 26 display::Display::SetInternalDisplayId(kInvalidDisplayId);
34 } 27 }
35 28
36 } // namespace 29 } // namespace
37 30
38 TEST(DisplayUtilitiesTest, GenerateDisplayIdList) { 31 TEST(DisplayUtilitiesTest, GenerateDisplayIdList) {
39 display::DisplayIdList list; 32 display::DisplayIdList list;
40 { 33 {
41 int64_t ids[] = {10, 1}; 34 int64_t ids[] = {10, 1};
42 list = GenerateDisplayIdList(std::begin(ids), std::end(ids)); 35 list = GenerateDisplayIdList(std::begin(ids), std::end(ids));
43 EXPECT_EQ(1, list[0]); 36 EXPECT_EQ(1, list[0]);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 { 106 {
114 ScopedSetInternalDisplayId set_internal(16); 107 ScopedSetInternalDisplayId set_internal(16);
115 int64_t ids[] = {10, 1, 16}; 108 int64_t ids[] = {10, 1, 16};
116 display::DisplayIdList list = 109 display::DisplayIdList list =
117 GenerateDisplayIdList(std::begin(ids), std::end(ids)); 110 GenerateDisplayIdList(std::begin(ids), std::end(ids));
118 EXPECT_EQ("16,1,10", DisplayIdListToString(list)); 111 EXPECT_EQ("16,1,10", DisplayIdListToString(list));
119 } 112 }
120 } 113 }
121 114
122 } // namespace display 115 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/manager/display_manager.cc ('k') | ui/display/manager/managed_display_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698