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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
6 #include "ash/display/display_manager.h" | 6 #include "ash/display/display_manager.h" |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
11 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
12 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
13 #include "ash/wm/coordinate_conversion.h" | 13 #include "ash/wm/coordinate_conversion.h" |
14 #include "ash/wm/property_util.h" | |
15 #include "ash/wm/window_cycle_controller.h" | 14 #include "ash/wm/window_cycle_controller.h" |
16 #include "ash/wm/window_properties.h" | 15 #include "ash/wm/window_properties.h" |
17 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
18 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
19 #include "ui/aura/client/activation_client.h" | 18 #include "ui/aura/client/activation_client.h" |
20 #include "ui/aura/client/capture_client.h" | 19 #include "ui/aura/client/capture_client.h" |
21 #include "ui/aura/client/focus_client.h" | 20 #include "ui/aura/client/focus_client.h" |
22 #include "ui/aura/root_window.h" | 21 #include "ui/aura/root_window.h" |
23 #include "ui/aura/test/event_generator.h" | 22 #include "ui/aura/test/event_generator.h" |
24 #include "ui/aura/test/test_windows.h" | 23 #include "ui/aura/test/test_windows.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (!SupportsMultipleDisplays()) | 160 if (!SupportsMultipleDisplays()) |
162 return; | 161 return; |
163 | 162 |
164 UpdateDisplay("1000x600,600x400"); | 163 UpdateDisplay("1000x600,600x400"); |
165 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 164 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
166 | 165 |
167 // All root windows must have the root window controller. | 166 // All root windows must have the root window controller. |
168 ASSERT_EQ(2U, root_windows.size()); | 167 ASSERT_EQ(2U, root_windows.size()); |
169 for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); | 168 for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
170 iter != root_windows.end(); ++iter) { | 169 iter != root_windows.end(); ++iter) { |
171 EXPECT_TRUE(GetRootWindowController(*iter) != NULL); | 170 EXPECT_TRUE(internal::GetRootWindowController(*iter) != NULL); |
172 } | 171 } |
173 // Make sure root windows share the same controllers. | 172 // Make sure root windows share the same controllers. |
174 EXPECT_EQ(aura::client::GetFocusClient(root_windows[0]), | 173 EXPECT_EQ(aura::client::GetFocusClient(root_windows[0]), |
175 aura::client::GetFocusClient(root_windows[1])); | 174 aura::client::GetFocusClient(root_windows[1])); |
176 EXPECT_EQ(aura::client::GetActivationClient(root_windows[0]), | 175 EXPECT_EQ(aura::client::GetActivationClient(root_windows[0]), |
177 aura::client::GetActivationClient(root_windows[1])); | 176 aura::client::GetActivationClient(root_windows[1])); |
178 EXPECT_EQ(aura::client::GetCaptureClient(root_windows[0]), | 177 EXPECT_EQ(aura::client::GetCaptureClient(root_windows[0]), |
179 aura::client::GetCaptureClient(root_windows[1])); | 178 aura::client::GetCaptureClient(root_windows[1])); |
180 } | 179 } |
181 | 180 |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 generator.ReleaseLeftButton(); | 840 generator.ReleaseLeftButton(); |
842 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); | 841 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); |
843 | 842 |
844 generator.MoveMouseTo(400, 150); | 843 generator.MoveMouseTo(400, 150); |
845 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); | 844 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); |
846 | 845 |
847 ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 846 ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
848 } | 847 } |
849 | 848 |
850 } // namespace ash | 849 } // namespace ash |
OLD | NEW |