| OLD | NEW |
| 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/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "ash/wm/workspace/snap_sizer.h" | 10 #include "ash/wm/workspace/snap_sizer.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 TEST_F(ToplevelWindowEventHandlerTest, MAYBE_EscapeReverts) { | 468 TEST_F(ToplevelWindowEventHandlerTest, MAYBE_EscapeReverts) { |
| 469 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 469 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); |
| 470 aura::client::ActivationClient* original_client = | 470 aura::client::ActivationClient* original_client = |
| 471 aura::client::GetActivationClient(root); | 471 aura::client::GetActivationClient(root); |
| 472 aura::test::TestActivationClient activation_client(root); | 472 aura::test::TestActivationClient activation_client(root); |
| 473 scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT)); | 473 scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT)); |
| 474 target->Focus(); | 474 target->Focus(); |
| 475 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), | 475 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), |
| 476 target.get()); | 476 target.get()); |
| 477 generator.PressLeftButton(); | 477 generator.PressLeftButton(); |
| 478 generator.MoveMouseTo(generator.current_location().Add(gfx::Point(10, 11))); | 478 generator.MoveMouseBy(10, 11); |
| 479 | 479 |
| 480 // Execute any scheduled draws so that pending mouse events are processed. | 480 // Execute any scheduled draws so that pending mouse events are processed. |
| 481 RunAllPendingInMessageLoop(); | 481 RunAllPendingInMessageLoop(); |
| 482 | 482 |
| 483 EXPECT_EQ("0,0 110x111", target->bounds().ToString()); | 483 EXPECT_EQ("0,0 110x111", target->bounds().ToString()); |
| 484 generator.PressKey(ui::VKEY_ESCAPE, 0); | 484 generator.PressKey(ui::VKEY_ESCAPE, 0); |
| 485 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); | 485 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); |
| 486 EXPECT_EQ("0,0 100x100", target->bounds().ToString()); | 486 EXPECT_EQ("0,0 100x100", target->bounds().ToString()); |
| 487 aura::client::SetActivationClient(root, original_client); | 487 aura::client::SetActivationClient(root, original_client); |
| 488 } | 488 } |
| 489 | 489 |
| 490 } // namespace test | 490 } // namespace test |
| 491 } // namespace ash | 491 } // namespace ash |
| OLD | NEW |