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