| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/host_desktop.h" | 15 #include "chrome/browser/ui/host_desktop.h" |
| 15 #include "chrome/test/base/test_browser_window.h" | 16 #include "chrome/test/base/test_browser_window.h" |
| 16 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 17 #include "content/public/test/render_view_test.h" | 18 #include "content/public/test/render_view_test.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
| 20 #include "ui/aura/test/test_windows.h" | 21 #include "ui/aura/test/test_windows.h" |
| 21 #include "ui/aura/window_event_dispatcher.h" | 22 #include "ui/aura/window_event_dispatcher.h" |
| 22 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 49 | 50 |
| 50 } // namespace | 51 } // namespace |
| 51 | 52 |
| 52 // A test class for preparing window positioner tests - it creates a testing | 53 // A test class for preparing window positioner tests - it creates a testing |
| 53 // base by adding a window and a popup which can be independently | 54 // base by adding a window and a popup which can be independently |
| 54 // positioned to see where the positioner will place the window. | 55 // positioned to see where the positioner will place the window. |
| 55 class WindowPositionerTest : public AshTestBase { | 56 class WindowPositionerTest : public AshTestBase { |
| 56 public: | 57 public: |
| 57 WindowPositionerTest(); | 58 WindowPositionerTest(); |
| 58 | 59 |
| 60 static void SetUpTestCase() { |
| 61 // Creating a browser requires platform parental controls initialization. |
| 62 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 63 } |
| 64 |
| 65 static void TearDownTestCase() { |
| 66 IncognitoModePrefs::UninitializePlatformParentalControls(); |
| 67 } |
| 68 |
| 59 void SetUp() override; | 69 void SetUp() override; |
| 60 void TearDown() override; | 70 void TearDown() override; |
| 61 | 71 |
| 62 protected: | 72 protected: |
| 63 aura::Window* window() { return window_.get(); } | 73 aura::Window* window() { return window_.get(); } |
| 64 aura::Window* popup() { return popup_.get(); } | 74 aura::Window* popup() { return popup_.get(); } |
| 65 | 75 |
| 66 Browser* window_browser() { return window_owning_browser_.get(); } | 76 Browser* window_browser() { return window_owning_browser_.get(); } |
| 67 Browser* popup_browser() { return popup_owning_browser_.get(); } | 77 Browser* popup_browser() { return popup_owning_browser_.get(); } |
| 68 | 78 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 281 |
| 272 // Check that the popup is placed full screen. | 282 // Check that the popup is placed full screen. |
| 273 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 283 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
| 274 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 284 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
| 275 pop_position.width(), pop_position.height()), | 285 pop_position.width(), pop_position.height()), |
| 276 full); | 286 full); |
| 277 } | 287 } |
| 278 | 288 |
| 279 } // namespace test | 289 } // namespace test |
| 280 } // namespace ash | 290 } // namespace ash |
| OLD | NEW |