| 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 "chrome/test/base/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chrome/browser/profiles/profile_destroyer.h" | 8 #include "chrome/browser/profiles/profile_destroyer.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "ash/test/ash_test_helper.h" | 28 #include "ash/test/ash_test_helper.h" |
| 29 #include "ash/test/ash_test_views_delegate.h" | 29 #include "ash/test/ash_test_views_delegate.h" |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 #if defined(TOOLKIT_VIEWS) | 32 #if defined(TOOLKIT_VIEWS) |
| 33 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" | 33 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" |
| 34 #include "components/constrained_window/constrained_window_views.h" | 34 #include "components/constrained_window/constrained_window_views.h" |
| 35 #include "ui/views/test/test_views_delegate.h" | 35 #include "ui/views/test/test_views_delegate.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(OS_WIN) |
| 39 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 40 #endif |
| 41 |
| 38 using content::NavigationController; | 42 using content::NavigationController; |
| 39 using content::RenderFrameHost; | 43 using content::RenderFrameHost; |
| 40 using content::RenderFrameHostTester; | 44 using content::RenderFrameHostTester; |
| 41 using content::WebContents; | 45 using content::WebContents; |
| 42 | 46 |
| 43 BrowserWithTestWindowTest::BrowserWithTestWindowTest() | 47 BrowserWithTestWindowTest::BrowserWithTestWindowTest() |
| 44 : browser_type_(Browser::TYPE_TABBED), | 48 : browser_type_(Browser::TYPE_TABBED), |
| 45 host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE), | 49 host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE), |
| 46 hosted_app_(false) { | 50 hosted_app_(false) { |
| 47 } | 51 } |
| 48 | 52 |
| 49 BrowserWithTestWindowTest::BrowserWithTestWindowTest( | 53 BrowserWithTestWindowTest::BrowserWithTestWindowTest( |
| 50 Browser::Type browser_type, | 54 Browser::Type browser_type, |
| 51 chrome::HostDesktopType host_desktop_type, | 55 chrome::HostDesktopType host_desktop_type, |
| 52 bool hosted_app) | 56 bool hosted_app) |
| 53 : browser_type_(browser_type), | 57 : browser_type_(browser_type), |
| 54 host_desktop_type_(host_desktop_type), | 58 host_desktop_type_(host_desktop_type), |
| 55 hosted_app_(hosted_app) { | 59 hosted_app_(hosted_app) { |
| 56 } | 60 } |
| 57 | 61 |
| 58 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { | 62 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { |
| 59 } | 63 } |
| 60 | 64 |
| 65 void BrowserWithTestWindowTest::SetUpTestCase() { |
| 66 #if defined(OS_WIN) |
| 67 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 68 #endif // OS_WIN |
| 69 } |
| 70 |
| 61 void BrowserWithTestWindowTest::SetUp() { | 71 void BrowserWithTestWindowTest::SetUp() { |
| 62 testing::Test::SetUp(); | 72 testing::Test::SetUp(); |
| 63 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
| 64 // TODO(jamescook): Windows Ash support. This will require refactoring | 74 // TODO(jamescook): Windows Ash support. This will require refactoring |
| 65 // AshTestHelper and AuraTestHelper so they can be used at the same time, | 75 // AshTestHelper and AuraTestHelper so they can be used at the same time, |
| 66 // perhaps by AshTestHelper owning an AuraTestHelper. Also, need to cleanup | 76 // perhaps by AshTestHelper owning an AuraTestHelper. Also, need to cleanup |
| 67 // CreateViewsDelegate() below when cleanup done. | 77 // CreateViewsDelegate() below when cleanup done. |
| 68 ash_test_helper_.reset(new ash::test::AshTestHelper( | 78 ash_test_helper_.reset(new ash::test::AshTestHelper( |
| 69 base::MessageLoopForUI::current())); | 79 base::MessageLoopForUI::current())); |
| 70 ash_test_helper_->SetUp(true); | 80 ash_test_helper_->SetUp(true); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 261 |
| 252 #if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS) | 262 #if !defined(OS_CHROMEOS) && defined(TOOLKIT_VIEWS) |
| 253 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { | 263 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { |
| 254 #if defined(USE_ASH) | 264 #if defined(USE_ASH) |
| 255 return new ash::test::AshTestViewsDelegate; | 265 return new ash::test::AshTestViewsDelegate; |
| 256 #else | 266 #else |
| 257 return new views::TestViewsDelegate; | 267 return new views::TestViewsDelegate; |
| 258 #endif | 268 #endif |
| 259 } | 269 } |
| 260 #endif | 270 #endif |
| OLD | NEW |