Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: ash/extended_desktop_unittest.cc

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/mus/move_event_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/mus/move_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698