| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 parent_ = NULL; | 86 parent_ = NULL; |
| 87 AshTestBase::TearDown(); | 87 AshTestBase::TearDown(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 aura::Window* CreateWindow(int hittest_code) { | 91 aura::Window* CreateWindow(int hittest_code) { |
| 92 TestWindowDelegate* d1 = new TestWindowDelegate(hittest_code); | 92 TestWindowDelegate* d1 = new TestWindowDelegate(hittest_code); |
| 93 aura::Window* w1 = new aura::Window(d1); | 93 aura::Window* w1 = new aura::Window(d1); |
| 94 w1->set_id(1); | 94 w1->set_id(1); |
| 95 w1->Init(ui::LAYER_TEXTURED); | 95 w1->Init(ui::LAYER_TEXTURED); |
| 96 w1->SetParent(parent_); | 96 parent_->AddChild(w1); |
| 97 w1->SetBounds(gfx::Rect(0, 0, 100, 100)); | 97 w1->SetBounds(gfx::Rect(0, 0, 100, 100)); |
| 98 w1->Show(); | 98 w1->Show(); |
| 99 return w1; | 99 return w1; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void DragFromCenterBy(aura::Window* window, int dx, int dy) { | 102 void DragFromCenterBy(aura::Window* window, int dx, int dy) { |
| 103 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); | 103 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); |
| 104 generator.DragMouseBy(dx, dy); | 104 generator.DragMouseBy(dx, dy); |
| 105 } | 105 } |
| 106 | 106 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 generator.PressLeftButton(); | 529 generator.PressLeftButton(); |
| 530 generator.MoveMouseBy(10, 11); | 530 generator.MoveMouseBy(10, 11); |
| 531 RunAllPendingInMessageLoop(); | 531 RunAllPendingInMessageLoop(); |
| 532 EXPECT_EQ("10,11 100x100", target->bounds().ToString()); | 532 EXPECT_EQ("10,11 100x100", target->bounds().ToString()); |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace test | 536 } // namespace test |
| 537 } // namespace ash | 537 } // namespace ash |
| OLD | NEW |