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

Side by Side Diff: ash/wm/ash_native_cursor_manager_unittest.cc

Issue 251743004: aura: Remove WindowTreeHost::QueryMouseLocation(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | Annotate | Revision Log
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/wm/ash_native_cursor_manager.h" 5 #include "ash/wm/ash_native_cursor_manager.h"
6 6
7 #include "ash/display/display_info.h" 7 #include "ash/display/display_info.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
11 #include "ash/test/cursor_manager_test_api.h" 11 #include "ash/test/cursor_manager_test_api.h"
12 #include "ash/wm/image_cursors.h" 12 #include "ash/wm/image_cursors.h"
13 #include "ui/aura/test/aura_test_utils.h"
13 #include "ui/aura/test/test_window_delegate.h" 14 #include "ui/aura/test/test_window_delegate.h"
14 #include "ui/aura/test/test_windows.h" 15 #include "ui/aura/test/test_windows.h"
15 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
16 #include "ui/aura/window_event_dispatcher.h" 17 #include "ui/aura/window_event_dispatcher.h"
17 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
18 19
19 #if defined(OS_WIN) 20 #if defined(OS_WIN)
20 #include "base/win/windows_version.h" 21 #include "base/win/windows_version.h"
21 #include "ui/base/cursor/cursor_loader_win.h" 22 #include "ui/base/cursor/cursor_loader_win.h"
22 #endif 23 #endif
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 UpdateDisplay("800x800*2"); 168 UpdateDisplay("800x800*2");
168 EXPECT_EQ(2.0f, 169 EXPECT_EQ(2.0f,
169 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 170 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
170 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); 171 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
171 display_manager->SetDisplayUIScale(display_id, 2.0f); 172 display_manager->SetDisplayUIScale(display_id, 2.0f);
172 EXPECT_EQ(1.0f, 173 EXPECT_EQ(1.0f,
173 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 174 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
174 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); 175 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
175 } 176 }
176 177
177 TEST_F(AshNativeCursorManagerTest, DisabledQueryMouseLocation) {
178 aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
179 #if defined(OS_WIN)
180 if (base::win::GetVersion() < base::win::VERSION_WIN8)
181 return;
182 // On Windows 8 the ASH environment has two processes, the viewer process
183 // which runs in Windows 8 mode and the browser process. The initialization
184 // happens when the viewer process connects to the browser channel and sends
185 // the initial IPC message.
186 RunAllPendingInMessageLoop();
187 #endif
188 root_window->MoveCursorTo(gfx::Point(10, 10));
189 #if defined(OS_WIN)
190 // The MoveCursor operation on Windows 8 is implemented in the viewer process
191 // which is notified by an IPC message to perform the MoveCursor operation.
192 // We need to ensure that the IPC is delivered to the viewer process and it
193 // the ACK is sent back from the viewer indicating that the operation
194 // completed.
195 Sleep(100);
196 RunAllPendingInMessageLoop();
197 #endif
198 aura::WindowTreeHost* host = root_window->GetHost();
199 gfx::Point mouse_location;
200 EXPECT_TRUE(host->QueryMouseLocation(&mouse_location));
201 EXPECT_EQ("10,10", mouse_location.ToString());
202 Shell::GetInstance()->cursor_manager()->DisableMouseEvents();
203 EXPECT_FALSE(host->QueryMouseLocation(&mouse_location));
204 EXPECT_EQ("0,0", mouse_location.ToString());
205 }
206
207 } // namespace test 178 } // namespace test
208 } // namespace ash 179 } // namespace ash
OLDNEW
« no previous file with comments | « ash/magnifier/magnification_controller_unittest.cc ('k') | mojo/examples/aura_demo/window_tree_host_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698