OLD | NEW |
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" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 aura::Window* window = widget()->GetNativeWindow(); | 478 aura::Window* window = widget()->GetNativeWindow(); |
479 aura::Window* root_window = window->GetRootWindow(); | 479 aura::Window* root_window = window->GetRootWindow(); |
480 ash::FrameMaximizeButton* maximize_button = | 480 ash::FrameMaximizeButton* maximize_button = |
481 FrameMaximizeButtonTest::maximize_button(); | 481 FrameMaximizeButtonTest::maximize_button(); |
482 gfx::Point button_pos = maximize_button->GetBoundsInScreen().CenterPoint(); | 482 gfx::Point button_pos = maximize_button->GetBoundsInScreen().CenterPoint(); |
483 | 483 |
484 const int touch_default_radius = | 484 const int touch_default_radius = |
485 ui::GestureConfiguration::default_radius(); | 485 ui::GestureConfiguration::default_radius(); |
486 ui::GestureConfiguration::set_default_radius(0); | 486 ui::GestureConfiguration::set_default_radius(0); |
487 | 487 |
488 aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); | 488 aura::WindowEventDispatcher* dispatcher = |
| 489 root_window->GetHost()->dispatcher(); |
489 const int kTouchId = 2; | 490 const int kTouchId = 2; |
490 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, | 491 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, |
491 button_pos, | 492 button_pos, |
492 kTouchId, | 493 kTouchId, |
493 ui::EventTimeForNow()); | 494 ui::EventTimeForNow()); |
494 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 495 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); |
495 ASSERT_FALSE(details.dispatcher_destroyed); | 496 ASSERT_FALSE(details.dispatcher_destroyed); |
496 | 497 |
497 button_pos.Offset(9, 8); | 498 button_pos.Offset(9, 8); |
498 ui::TouchEvent release( | 499 ui::TouchEvent release( |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 805 |
805 // 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. |
806 EXPECT_FALSE(maximize_button->maximizer()); | 807 EXPECT_FALSE(maximize_button->maximizer()); |
807 EXPECT_FALSE(maximize_button->phantom_window_open()); | 808 EXPECT_FALSE(maximize_button->phantom_window_open()); |
808 EXPECT_TRUE(wm::GetWindowState(window)->IsNormalStateType()); | 809 EXPECT_TRUE(wm::GetWindowState(window)->IsNormalStateType()); |
809 EXPECT_EQ(initial_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 810 EXPECT_EQ(initial_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
810 } | 811 } |
811 | 812 |
812 } // namespace test | 813 } // namespace test |
813 } // namespace ash | 814 } // namespace ash |
OLD | NEW |