| 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/scoped_target_root_window.h" | 5 #include "ash/scoped_target_root_window.h" |
| 6 #include "ash/screen_util.h" | 6 #include "ash/screen_util.h" |
| 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_positioner.h" | 10 #include "ash/wm/window_positioner.h" |
| 11 #include "ash/wm/window_resizer.h" | 11 #include "ash/wm/window_resizer.h" |
| 12 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 14 #include "chrome/browser/ui/ash/ash_util.h" | 15 #include "chrome/browser/ui/ash/ash_util.h" |
| 15 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" | 17 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 19 #include "content/public/test/render_view_test.h" | 20 #include "content/public/test/render_view_test.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
| 22 #include "ui/aura/env.h" | 23 #include "ui/aura/env.h" |
| 23 #include "ui/aura/test/test_windows.h" | 24 #include "ui/aura/test/test_windows.h" |
| 24 #include "ui/aura/window_event_dispatcher.h" | 25 #include "ui/aura/window_event_dispatcher.h" |
| 25 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
| 26 #include "ui/wm/public/activation_client.h" | 27 #include "ui/wm/public/activation_client.h" |
| 27 | 28 |
| 28 typedef ash::test::AshTestBase WindowSizerAshTest; | 29 class WindowSizerAshTest : public ash::test::AshTestBase { |
| 30 protected: |
| 31 static void SetUpTestCase() { |
| 32 ash::test::AshTestBase::SetUpTestCase(); |
| 33 // Creating a browser requires platform parental controls initialization. |
| 34 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 35 } |
| 36 |
| 37 static void TearDownTestCase() { |
| 38 IncognitoModePrefs::UninitializePlatformParentalControls(); |
| 39 ash::test::AshTestBase::TearDownTestCase(); |
| 40 } |
| 41 }; |
| 29 | 42 |
| 30 namespace { | 43 namespace { |
| 31 | 44 |
| 32 // A browser window proxy which is able to associate an aura native window with | 45 // A browser window proxy which is able to associate an aura native window with |
| 33 // it. | 46 // it. |
| 34 class TestBrowserWindowAura : public TestBrowserWindow { | 47 class TestBrowserWindowAura : public TestBrowserWindow { |
| 35 public: | 48 public: |
| 36 // |native_window| will still be owned by the caller after the constructor | 49 // |native_window| will still be owned by the caller after the constructor |
| 37 // was called. | 50 // was called. |
| 38 explicit TestBrowserWindowAura(aura::Window* native_window) | 51 explicit TestBrowserWindowAura(aura::Window* native_window) |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 p1600x1200)); | 1014 p1600x1200)); |
| 1002 // A popup that is sized to occupy the whole work area has default state. | 1015 // A popup that is sized to occupy the whole work area has default state. |
| 1003 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 1016 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
| 1004 GetWindowShowState(ui::SHOW_STATE_DEFAULT, | 1017 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
| 1005 ui::SHOW_STATE_NORMAL, | 1018 ui::SHOW_STATE_NORMAL, |
| 1006 BOTH, | 1019 BOTH, |
| 1007 trusted_popup->browser(), | 1020 trusted_popup->browser(), |
| 1008 p1600x1200, | 1021 p1600x1200, |
| 1009 p1600x1200)); | 1022 p1600x1200)); |
| 1010 } | 1023 } |
| OLD | NEW |