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

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

Issue 270863005: Use native coordinates to warp the cursor to another display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/wm/drag_window_resizer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/immersive_fullscreen_controller.h" 5 #include "ash/wm/immersive_fullscreen_controller.h"
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/display/mouse_cursor_event_filter.h"
8 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_types.h" 11 #include "ash/shelf/shelf_types.h"
11 #include "ash/shell.h" 12 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 13 #include "ash/test/ash_test_base.h"
13 #include "ui/aura/client/aura_constants.h" 14 #include "ui/aura/client/aura_constants.h"
14 #include "ui/aura/client/cursor_client.h" 15 #include "ui/aura/client/cursor_client.h"
15 #include "ui/aura/env.h" 16 #include "ui/aura/env.h"
16 #include "ui/aura/test/event_generator.h" 17 #include "ui/aura/test/event_generator.h"
17 #include "ui/aura/test/test_window_delegate.h" 18 #include "ui/aura/test/test_window_delegate.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // running. 534 // running.
534 event_generator.MoveMouseTo(x, y_top_edge + 1); 535 event_generator.MoveMouseTo(x, y_top_edge + 1);
535 EXPECT_TRUE(top_edge_hover_timer_running()); 536 EXPECT_TRUE(top_edge_hover_timer_running());
536 EXPECT_EQ(y_top_edge + 1, 537 EXPECT_EQ(y_top_edge + 1,
537 aura::Env::GetInstance()->last_mouse_location().y()); 538 aura::Env::GetInstance()->last_mouse_location().y());
538 539
539 // The timer should continue running if the user moves the mouse to the top 540 // The timer should continue running if the user moves the mouse to the top
540 // edge even though the mouse is warped to the secondary display. 541 // edge even though the mouse is warped to the secondary display.
541 event_generator.MoveMouseTo(x, y_top_edge); 542 event_generator.MoveMouseTo(x, y_top_edge);
542 EXPECT_TRUE(top_edge_hover_timer_running()); 543 EXPECT_TRUE(top_edge_hover_timer_running());
543 EXPECT_NE(y_top_edge, 544
544 aura::Env::GetInstance()->last_mouse_location().y()); 545 // TODO(oshima): Provide a test API to handle mouse warp more easily.
546 if (!MouseCursorEventFilter::IsMouseWarpInNativeCoordsEnabled()) {
547 EXPECT_NE(y_top_edge,
548 aura::Env::GetInstance()->last_mouse_location().y());
549 }
545 550
546 // The timer should continue running if the user overshoots the top edge 551 // The timer should continue running if the user overshoots the top edge
547 // a bit. 552 // a bit.
548 event_generator.MoveMouseTo(x, y_top_edge - 2); 553 event_generator.MoveMouseTo(x, y_top_edge - 2);
549 EXPECT_TRUE(top_edge_hover_timer_running()); 554 EXPECT_TRUE(top_edge_hover_timer_running());
550 555
551 // The timer should stop running if the user overshoots the top edge by 556 // The timer should stop running if the user overshoots the top edge by
552 // a lot. 557 // a lot.
553 event_generator.MoveMouseTo(x, y_top_edge - 20); 558 event_generator.MoveMouseTo(x, y_top_edge - 20);
554 EXPECT_FALSE(top_edge_hover_timer_running()); 559 EXPECT_FALSE(top_edge_hover_timer_running());
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); 1053 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state());
1049 1054
1050 // Disabling immersive fullscreen maintains the user's auto-hide selection. 1055 // Disabling immersive fullscreen maintains the user's auto-hide selection.
1051 SetEnabled(false); 1056 SetEnabled(false);
1052 window()->SetProperty(aura::client::kShowStateKey, 1057 window()->SetProperty(aura::client::kShowStateKey,
1053 ui::SHOW_STATE_NORMAL); 1058 ui::SHOW_STATE_NORMAL);
1054 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); 1059 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state());
1055 } 1060 }
1056 1061
1057 } // namespase ash 1062 } // namespase ash
OLDNEW
« no previous file with comments | « ash/wm/drag_window_resizer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698