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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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
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/display/mouse_cursor_event_filter.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 349
350 ui::test::EventGenerator& event_generator(GetEventGenerator()); 350 ui::test::EventGenerator& event_generator(GetEventGenerator());
351 351
352 gfx::Rect top_container_bounds_in_screen = 352 gfx::Rect top_container_bounds_in_screen =
353 top_container()->GetBoundsInScreen(); 353 top_container()->GetBoundsInScreen();
354 // A position along the top edge of TopContainerView in screen coordinates. 354 // A position along the top edge of TopContainerView in screen coordinates.
355 gfx::Point top_edge_pos(top_container_bounds_in_screen.x() + 100, 355 gfx::Point top_edge_pos(top_container_bounds_in_screen.x() + 100,
356 top_container_bounds_in_screen.y()); 356 top_container_bounds_in_screen.y());
357 357
358 // Mouse wheel event does nothing. 358 // Mouse wheel event does nothing.
359 ui::MouseEvent wheel(ui::ET_MOUSEWHEEL, top_edge_pos, top_edge_pos, 359 ui::MouseEvent wheel(
360 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 360 ui::ET_MOUSEWHEEL, top_edge_pos, top_edge_pos, ui::EventTimeForNow(),
361 ui::EF_NONE, ui::EF_NONE,
362 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
361 event_generator.Dispatch(&wheel); 363 event_generator.Dispatch(&wheel);
362 EXPECT_FALSE(top_edge_hover_timer_running()); 364 EXPECT_FALSE(top_edge_hover_timer_running());
363 365
364 // Move to top edge of screen starts hover timer running. We cannot use 366 // Move to top edge of screen starts hover timer running. We cannot use
365 // MoveMouse() because MoveMouse() stops the timer if it started running. 367 // MoveMouse() because MoveMouse() stops the timer if it started running.
366 event_generator.MoveMouseTo(top_edge_pos); 368 event_generator.MoveMouseTo(top_edge_pos);
367 EXPECT_TRUE(top_edge_hover_timer_running()); 369 EXPECT_TRUE(top_edge_hover_timer_running());
368 EXPECT_EQ(top_edge_pos.x(), mouse_x_when_hit_top()); 370 EXPECT_EQ(top_edge_pos.x(), mouse_x_when_hit_top());
369 371
370 // Moving |ImmersiveFullscreenControllerTest::kMouseRevealBoundsHeight| down 372 // Moving |ImmersiveFullscreenControllerTest::kMouseRevealBoundsHeight| down
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); 1062 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state());
1061 1063
1062 // Disabling immersive fullscreen maintains the user's auto-hide selection. 1064 // Disabling immersive fullscreen maintains the user's auto-hide selection.
1063 SetEnabled(false); 1065 SetEnabled(false);
1064 window()->SetProperty(aura::client::kShowStateKey, 1066 window()->SetProperty(aura::client::kShowStateKey,
1065 ui::SHOW_STATE_NORMAL); 1067 ui::SHOW_STATE_NORMAL);
1066 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state()); 1068 EXPECT_EQ(ash::SHELF_AUTO_HIDE, shelf->visibility_state());
1067 } 1069 }
1068 1070
1069 } // namespase ash 1071 } // namespase ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698