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/window_positioner.h" | 5 #include "ash/wm/window_positioner.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/test/test_shell_delegate.h" | 9 #include "ash/test/test_shell_delegate.h" |
10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace ash { | 24 namespace ash { |
25 namespace test { | 25 namespace test { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // A browser window proxy which is able to associate an aura native window with | 29 // A browser window proxy which is able to associate an aura native window with |
30 // it. | 30 // it. |
31 class TestBrowserWindowAura : public TestBrowserWindow { | 31 class TestBrowserWindowAura : public TestBrowserWindow { |
32 public: | 32 public: |
33 explicit TestBrowserWindowAura(aura::Window* native_window); | 33 explicit TestBrowserWindowAura(aura::Window* native_window); |
34 virtual ~TestBrowserWindowAura(); | 34 ~TestBrowserWindowAura() override; |
35 | 35 |
36 virtual gfx::NativeWindow GetNativeWindow() override { | 36 gfx::NativeWindow GetNativeWindow() override { return native_window_; } |
37 return native_window_; | |
38 } | |
39 | 37 |
40 private: | 38 private: |
41 gfx::NativeWindow native_window_; | 39 gfx::NativeWindow native_window_; |
42 | 40 |
43 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura); | 41 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura); |
44 }; | 42 }; |
45 | 43 |
46 TestBrowserWindowAura::TestBrowserWindowAura(aura::Window *native_window) | 44 TestBrowserWindowAura::TestBrowserWindowAura(aura::Window *native_window) |
47 : native_window_(native_window) { | 45 : native_window_(native_window) { |
48 } | 46 } |
49 | 47 |
50 TestBrowserWindowAura::~TestBrowserWindowAura() {} | 48 TestBrowserWindowAura::~TestBrowserWindowAura() {} |
51 | 49 |
52 } // namespace | 50 } // namespace |
53 | 51 |
54 // A test class for preparing window positioner tests - it creates a testing | 52 // A test class for preparing window positioner tests - it creates a testing |
55 // base by adding a window and a popup which can be independently | 53 // base by adding a window and a popup which can be independently |
56 // positioned to see where the positioner will place the window. | 54 // positioned to see where the positioner will place the window. |
57 class WindowPositionerTest : public AshTestBase { | 55 class WindowPositionerTest : public AshTestBase { |
58 public: | 56 public: |
59 WindowPositionerTest(); | 57 WindowPositionerTest(); |
60 | 58 |
61 virtual void SetUp() override; | 59 void SetUp() override; |
62 virtual void TearDown() override; | 60 void TearDown() override; |
63 | 61 |
64 protected: | 62 protected: |
65 aura::Window* window() { return window_.get(); } | 63 aura::Window* window() { return window_.get(); } |
66 aura::Window* popup() { return popup_.get(); } | 64 aura::Window* popup() { return popup_.get(); } |
67 | 65 |
68 Browser* window_browser() { return window_owning_browser_.get(); } | 66 Browser* window_browser() { return window_owning_browser_.get(); } |
69 Browser* popup_browser() { return popup_owning_browser_.get(); } | 67 Browser* popup_browser() { return popup_owning_browser_.get(); } |
70 | 68 |
71 WindowPositioner* window_positioner() { return window_positioner_; } | 69 WindowPositioner* window_positioner() { return window_positioner_; } |
72 | 70 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 271 |
274 // Check that the popup is placed full screen. | 272 // Check that the popup is placed full screen. |
275 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 273 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
276 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 274 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
277 pop_position.width(), pop_position.height()), | 275 pop_position.width(), pop_position.height()), |
278 full); | 276 full); |
279 } | 277 } |
280 | 278 |
281 } // namespace test | 279 } // namespace test |
282 } // namespace ash | 280 } // namespace ash |
OLD | NEW |