OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/views/mus/display_list.h" | 5 #include "ui/display/display_list.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/display/display.h" | 12 #include "ui/display/display.h" |
13 #include "ui/display/display_observer.h" | 13 #include "ui/display/display_observer.h" |
14 | 14 |
15 using display::Display; | 15 using display::Display; |
16 | 16 |
17 namespace views { | 17 namespace display { |
18 namespace { | 18 namespace { |
19 | 19 |
20 class DisplayObserverImpl : public display::DisplayObserver { | 20 class DisplayObserverImpl : public display::DisplayObserver { |
21 public: | 21 public: |
22 DisplayObserverImpl() {} | 22 DisplayObserverImpl() {} |
23 ~DisplayObserverImpl() override {} | 23 ~DisplayObserverImpl() override {} |
24 | 24 |
25 std::string GetAndClearChanges() { | 25 std::string GetAndClearChanges() { |
26 std::string changes; | 26 std::string changes; |
27 std::swap(changes, changes_); | 27 std::swap(changes, changes_); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 EXPECT_EQ(3, display_list.GetPrimaryDisplayIterator()->id()); | 103 EXPECT_EQ(3, display_list.GetPrimaryDisplayIterator()->id()); |
104 | 104 |
105 // Delete the first. | 105 // Delete the first. |
106 display_list.RemoveDisplay(2); | 106 display_list.RemoveDisplay(2); |
107 ASSERT_EQ(1u, display_list.displays().size()); | 107 ASSERT_EQ(1u, display_list.displays().size()); |
108 EXPECT_EQ("Removed id=2", observer.GetAndClearChanges()); | 108 EXPECT_EQ("Removed id=2", observer.GetAndClearChanges()); |
109 EXPECT_EQ(3, display_list.GetPrimaryDisplayIterator()->id()); | 109 EXPECT_EQ(3, display_list.GetPrimaryDisplayIterator()->id()); |
110 } | 110 } |
111 | 111 |
112 } // namespace | 112 } // namespace |
113 } // namespace views | 113 } // namespace display |
OLD | NEW |