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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 event_generator.ClickLeftButton(); | 249 event_generator.ClickLeftButton(); |
250 EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); | 250 EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); |
251 EXPECT_EQ(root_windows[0], Shell::GetRootWindowForNewWindows()); | 251 EXPECT_EQ(root_windows[0], Shell::GetRootWindowForNewWindows()); |
252 } | 252 } |
253 | 253 |
254 TEST_F(ExtendedDesktopTest, TestCursor) { | 254 TEST_F(ExtendedDesktopTest, TestCursor) { |
255 UpdateDisplay("1000x600,600x400"); | 255 UpdateDisplay("1000x600,600x400"); |
256 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 256 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
257 aura::WindowTreeHost* host0 = root_windows[0]->GetHost(); | 257 aura::WindowTreeHost* host0 = root_windows[0]->GetHost(); |
258 aura::WindowTreeHost* host1 = root_windows[1]->GetHost(); | 258 aura::WindowTreeHost* host1 = root_windows[1]->GetHost(); |
259 EXPECT_EQ(ui::kCursorPointer, host0->last_cursor().native_type()); | 259 EXPECT_EQ(ui::CursorType::kPointer, host0->last_cursor().native_type()); |
260 EXPECT_EQ(ui::kCursorNull, host1->last_cursor().native_type()); | 260 EXPECT_EQ(ui::CursorType::kNull, host1->last_cursor().native_type()); |
261 Shell::Get()->cursor_manager()->SetCursor(ui::kCursorCopy); | 261 Shell::Get()->cursor_manager()->SetCursor(ui::CursorType::kCopy); |
262 EXPECT_EQ(ui::kCursorCopy, host0->last_cursor().native_type()); | 262 EXPECT_EQ(ui::CursorType::kCopy, host0->last_cursor().native_type()); |
263 EXPECT_EQ(ui::kCursorCopy, host1->last_cursor().native_type()); | 263 EXPECT_EQ(ui::CursorType::kCopy, host1->last_cursor().native_type()); |
264 } | 264 } |
265 | 265 |
266 TEST_F(ExtendedDesktopTest, TestCursorLocation) { | 266 TEST_F(ExtendedDesktopTest, TestCursorLocation) { |
267 UpdateDisplay("1000x600,600x400"); | 267 UpdateDisplay("1000x600,600x400"); |
268 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 268 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
269 aura::test::WindowTestApi root_window0_test_api(root_windows[0]); | 269 aura::test::WindowTestApi root_window0_test_api(root_windows[0]); |
270 aura::test::WindowTestApi root_window1_test_api(root_windows[1]); | 270 aura::test::WindowTestApi root_window1_test_api(root_windows[1]); |
271 | 271 |
272 root_windows[0]->MoveCursorTo(gfx::Point(10, 10)); | 272 root_windows[0]->MoveCursorTo(gfx::Point(10, 10)); |
273 EXPECT_EQ("10,10", | 273 EXPECT_EQ("10,10", |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 generator.ReleaseLeftButton(); | 853 generator.ReleaseLeftButton(); |
854 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); | 854 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); |
855 | 855 |
856 generator.MoveMouseTo(400, 150); | 856 generator.MoveMouseTo(400, 150); |
857 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); | 857 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); |
858 | 858 |
859 ash::Shell::Get()->RemovePreTargetHandler(&event_handler); | 859 ash::Shell::Get()->RemovePreTargetHandler(&event_handler); |
860 } | 860 } |
861 | 861 |
862 } // namespace ash | 862 } // namespace ash |
OLD | NEW |