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 "components/mus/public/cpp/window.h" | 5 #include "components/mus/public/cpp/window.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 scoped_ptr<TestWindow> parent(CreateTestWindow(0, nullptr)); | 1125 scoped_ptr<TestWindow> parent(CreateTestWindow(0, nullptr)); |
1126 scoped_ptr<TestWindow> window0(CreateTestWindow(1, parent.get())); | 1126 scoped_ptr<TestWindow> window0(CreateTestWindow(1, parent.get())); |
1127 scoped_ptr<TestWindow> window1(CreateTestWindow(2, parent.get())); | 1127 scoped_ptr<TestWindow> window1(CreateTestWindow(2, parent.get())); |
1128 | 1128 |
1129 TestWindow* window2 = CreateTestWindow(3, parent.get()); | 1129 TestWindow* window2 = CreateTestWindow(3, parent.get()); |
1130 | 1130 |
1131 window0->AddTransientWindow(window2); | 1131 window0->AddTransientWindow(window2); |
1132 EXPECT_EQ("1 3 2", ChildWindowIDsAsString(parent.get())); | 1132 EXPECT_EQ("1 3 2", ChildWindowIDsAsString(parent.get())); |
1133 } | 1133 } |
1134 | 1134 |
| 1135 // Tests that a window does not have capture until it is explicitly set. |
| 1136 TEST_F(WindowTest, SetCapture) { |
| 1137 TestWindow w; |
| 1138 ASSERT_FALSE(w.has_capture()); |
| 1139 w.SetCapture(); |
| 1140 EXPECT_TRUE(w.has_capture()); |
| 1141 w.ReleaseCapture(); |
| 1142 EXPECT_FALSE(w.has_capture()); |
| 1143 } |
| 1144 |
1135 } // namespace mus | 1145 } // namespace mus |
OLD | NEW |