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

Side by Side Diff: ash/extended_desktop_unittest.cc

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/shell.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/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 #include "ash/display/multi_display_manager.h" 6 #include "ash/display/multi_display_manager.h"
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/wm/coordinate_conversion.h" 9 #include "ash/wm/coordinate_conversion.h"
10 #include "ash/wm/property_util.h" 10 #include "ash/wm/property_util.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // Close system modal and so clicking a widget should work now. 158 // Close system modal and so clicking a widget should work now.
159 modal_widget->Close(); 159 modal_widget->Close();
160 generator_1st.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); 160 generator_1st.MoveMouseToCenterOf(widget_on_1st->GetNativeView());
161 generator_1st.ClickLeftButton(); 161 generator_1st.ClickLeftButton();
162 EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); 162 EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView()));
163 EXPECT_EQ(root_windows[0], Shell::GetActiveRootWindow()); 163 EXPECT_EQ(root_windows[0], Shell::GetActiveRootWindow());
164 } 164 }
165 165
166 TEST_F(ExtendedDesktopTest, TestCursor) { 166 TEST_F(ExtendedDesktopTest, TestCursor) {
167 UpdateDisplay("1000x600,600x400"); 167 UpdateDisplay("1000x600,600x400");
168 Shell::GetInstance()->ShowCursor(false); 168 Shell::GetInstance()->cursor_manager()->ShowCursor(false);
169 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 169 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
170 EXPECT_FALSE(root_windows[0]->cursor_shown()); 170 EXPECT_FALSE(root_windows[0]->cursor_shown());
171 EXPECT_FALSE(root_windows[1]->cursor_shown()); 171 EXPECT_FALSE(root_windows[1]->cursor_shown());
172 Shell::GetInstance()->ShowCursor(true); 172 Shell::GetInstance()->cursor_manager()->ShowCursor(true);
173 EXPECT_TRUE(root_windows[0]->cursor_shown()); 173 EXPECT_TRUE(root_windows[0]->cursor_shown());
174 EXPECT_TRUE(root_windows[1]->cursor_shown()); 174 EXPECT_TRUE(root_windows[1]->cursor_shown());
175 175
176 EXPECT_EQ(ui::kCursorPointer, root_windows[0]->last_cursor().native_type()); 176 EXPECT_EQ(ui::kCursorPointer, root_windows[0]->last_cursor().native_type());
177 EXPECT_EQ(ui::kCursorPointer, root_windows[1]->last_cursor().native_type()); 177 EXPECT_EQ(ui::kCursorPointer, root_windows[1]->last_cursor().native_type());
178 Shell::GetInstance()->SetCursor(ui::kCursorCopy); 178 Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorCopy);
179 EXPECT_EQ(ui::kCursorCopy, root_windows[0]->last_cursor().native_type()); 179 EXPECT_EQ(ui::kCursorCopy, root_windows[0]->last_cursor().native_type());
180 EXPECT_EQ(ui::kCursorCopy, root_windows[1]->last_cursor().native_type()); 180 EXPECT_EQ(ui::kCursorCopy, root_windows[1]->last_cursor().native_type());
181 } 181 }
182 182
183 TEST_F(ExtendedDesktopTest, TestCursorLocation) { 183 TEST_F(ExtendedDesktopTest, TestCursorLocation) {
184 UpdateDisplay("0+0-1000x600,1001+0-600x400"); 184 UpdateDisplay("0+0-1000x600,1001+0-600x400");
185 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 185 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
186 aura::Window::TestApi root_window0_test_api(root_windows[0]); 186 aura::Window::TestApi root_window0_test_api(root_windows[0]);
187 aura::Window::TestApi root_window1_test_api(root_windows[1]); 187 aura::Window::TestApi root_window1_test_api(root_windows[1]);
188 188
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 p.SetPoint(0, 0); 533 p.SetPoint(0, 0);
534 aura::Window::ConvertPointToTarget(root_windows[0], root_windows[1], &p); 534 aura::Window::ConvertPointToTarget(root_windows[0], root_windows[1], &p);
535 EXPECT_EQ("0,-600", p.ToString()); 535 EXPECT_EQ("0,-600", p.ToString());
536 p.SetPoint(0, 0); 536 p.SetPoint(0, 0);
537 aura::Window::ConvertPointToTarget(d1, d2, &p); 537 aura::Window::ConvertPointToTarget(d1, d2, &p);
538 EXPECT_EQ("-10,-610", p.ToString()); 538 EXPECT_EQ("-10,-610", p.ToString());
539 } 539 }
540 540
541 } // namespace internal 541 } // namespace internal
542 } // namespace ash 542 } // namespace ash
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698