OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/cpp/shell_window_ids.h" | 5 #include "ash/public/cpp/shell_window_ids.h" |
6 #include "ash/root_window_controller.h" | 6 #include "ash/root_window_controller.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/wm/root_window_finder.h" | 10 #include "ash/wm/root_window_finder.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 params.context = context; | 157 params.context = context; |
158 params.bounds = bounds; | 158 params.bounds = bounds; |
159 params.child = child; | 159 params.child = child; |
160 views::Widget* widget = new views::Widget; | 160 views::Widget* widget = new views::Widget; |
161 widget->Init(params); | 161 widget->Init(params); |
162 widget->Show(); | 162 widget->Show(); |
163 return widget; | 163 return widget; |
164 } | 164 } |
165 }; | 165 }; |
166 | 166 |
167 // Test conditions that root windows in extended desktop mode | 167 // Test conditions that root windows in extended desktop mode must satisfy. |
168 // must satisfy. | |
169 TEST_F(ExtendedDesktopTest, Basic) { | 168 TEST_F(ExtendedDesktopTest, Basic) { |
170 UpdateDisplay("1000x600,600x400"); | 169 UpdateDisplay("1000x600,600x400"); |
171 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 170 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
172 | 171 |
173 // All root windows must have the root window controller. | 172 // All root windows must have a root window controller. |
174 ASSERT_EQ(2U, root_windows.size()); | 173 ASSERT_EQ(2U, root_windows.size()); |
175 for (aura::Window::Windows::const_iterator iter = root_windows.begin(); | 174 EXPECT_TRUE(RootWindowController::ForWindow(root_windows[0])); |
176 iter != root_windows.end(); ++iter) { | 175 EXPECT_TRUE(RootWindowController::ForWindow(root_windows[1])); |
177 EXPECT_TRUE(GetRootWindowController(*iter) != nullptr); | |
178 } | |
179 // Make sure root windows share the same controllers. | 176 // Make sure root windows share the same controllers. |
180 EXPECT_EQ(aura::client::GetFocusClient(root_windows[0]), | 177 EXPECT_EQ(aura::client::GetFocusClient(root_windows[0]), |
181 aura::client::GetFocusClient(root_windows[1])); | 178 aura::client::GetFocusClient(root_windows[1])); |
182 EXPECT_EQ(::wm::GetActivationClient(root_windows[0]), | 179 EXPECT_EQ(::wm::GetActivationClient(root_windows[0]), |
183 ::wm::GetActivationClient(root_windows[1])); | 180 ::wm::GetActivationClient(root_windows[1])); |
184 EXPECT_EQ(aura::client::GetCaptureClient(root_windows[0]), | 181 EXPECT_EQ(aura::client::GetCaptureClient(root_windows[0]), |
185 aura::client::GetCaptureClient(root_windows[1])); | 182 aura::client::GetCaptureClient(root_windows[1])); |
186 } | 183 } |
187 | 184 |
188 TEST_F(ExtendedDesktopTest, Activation) { | 185 TEST_F(ExtendedDesktopTest, Activation) { |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 generator.ReleaseLeftButton(); | 840 generator.ReleaseLeftButton(); |
844 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); | 841 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); |
845 | 842 |
846 generator.MoveMouseTo(400, 150); | 843 generator.MoveMouseTo(400, 150); |
847 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); | 844 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); |
848 | 845 |
849 ash::Shell::Get()->RemovePreTargetHandler(&event_handler); | 846 ash::Shell::Get()->RemovePreTargetHandler(&event_handler); |
850 } | 847 } |
851 | 848 |
852 } // namespace ash | 849 } // namespace ash |
OLD | NEW |