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

Side by Side Diff: ash/wm/caption_buttons/frame_maximize_button_unittest.cc

Issue 191153004: Provide access to the WindowEventDispatcher as a ui::EventProcessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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/test/ash_test_base.cc ('k') | ash/wm/window_manager_unittest.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 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/caption_buttons/frame_maximize_button.h" 5 #include "ash/wm/caption_buttons/frame_maximize_button.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" 10 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h"
11 #include "ash/wm/caption_buttons/maximize_bubble_controller.h" 11 #include "ash/wm/caption_buttons/maximize_bubble_controller.h"
12 #include "ash/wm/window_state.h" 12 #include "ash/wm/window_state.h"
13 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "grit/ash_resources.h" 15 #include "grit/ash_resources.h"
16 #include "ui/aura/client/focus_client.h" 16 #include "ui/aura/client/focus_client.h"
17 #include "ui/aura/test/event_generator.h" 17 #include "ui/aura/test/event_generator.h"
18 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
19 #include "ui/aura/window_event_dispatcher.h" 19 #include "ui/aura/window_tree_host.h"
20 #include "ui/events/event_processor.h"
20 #include "ui/events/event_utils.h" 21 #include "ui/events/event_utils.h"
21 #include "ui/events/gestures/gesture_configuration.h" 22 #include "ui/events/gestures/gesture_configuration.h"
22 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
23 #include "ui/views/widget/widget_delegate.h" 24 #include "ui/views/widget/widget_delegate.h"
24 25
25 namespace ash { 26 namespace ash {
26 namespace test { 27 namespace test {
27 28
28 namespace { 29 namespace {
29 30
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 aura::Window* window = widget()->GetNativeWindow(); 479 aura::Window* window = widget()->GetNativeWindow();
479 aura::Window* root_window = window->GetRootWindow(); 480 aura::Window* root_window = window->GetRootWindow();
480 ash::FrameMaximizeButton* maximize_button = 481 ash::FrameMaximizeButton* maximize_button =
481 FrameMaximizeButtonTest::maximize_button(); 482 FrameMaximizeButtonTest::maximize_button();
482 gfx::Point button_pos = maximize_button->GetBoundsInScreen().CenterPoint(); 483 gfx::Point button_pos = maximize_button->GetBoundsInScreen().CenterPoint();
483 484
484 const int touch_default_radius = 485 const int touch_default_radius =
485 ui::GestureConfiguration::default_radius(); 486 ui::GestureConfiguration::default_radius();
486 ui::GestureConfiguration::set_default_radius(0); 487 ui::GestureConfiguration::set_default_radius(0);
487 488
488 aura::WindowEventDispatcher* dispatcher = 489 ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor();
489 root_window->GetHost()->dispatcher();
490 const int kTouchId = 2; 490 const int kTouchId = 2;
491 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, 491 ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
492 button_pos, 492 button_pos,
493 kTouchId, 493 kTouchId,
494 ui::EventTimeForNow()); 494 ui::EventTimeForNow());
495 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); 495 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press);
496 ASSERT_FALSE(details.dispatcher_destroyed); 496 ASSERT_FALSE(details.dispatcher_destroyed);
497 497
498 button_pos.Offset(9, 8); 498 button_pos.Offset(9, 8);
499 ui::TouchEvent release( 499 ui::TouchEvent release(
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 805
806 // Test that we have properly reset the state of the now inactive window. 806 // Test that we have properly reset the state of the now inactive window.
807 EXPECT_FALSE(maximize_button->maximizer()); 807 EXPECT_FALSE(maximize_button->maximizer());
808 EXPECT_FALSE(maximize_button->phantom_window_open()); 808 EXPECT_FALSE(maximize_button->phantom_window_open());
809 EXPECT_TRUE(wm::GetWindowState(window)->IsNormalStateType()); 809 EXPECT_TRUE(wm::GetWindowState(window)->IsNormalStateType());
810 EXPECT_EQ(initial_bounds.ToString(), window->GetBoundsInScreen().ToString()); 810 EXPECT_EQ(initial_bounds.ToString(), window->GetBoundsInScreen().ToString());
811 } 811 }
812 812
813 } // namespace test 813 } // namespace test
814 } // namespace ash 814 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698