| 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/prefs/incognito_mode_prefs.h" |
| 8 #include "chrome/browser/profiles/profile_destroyer.h" | 9 #include "chrome/browser/profiles/profile_destroyer.h" |
| 9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 11 #include "chrome/browser/ui/browser_navigator.h" |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 12 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 14 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
| 15 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 17 #include "content/public/test/test_renderer_host.h" | 18 #include "content/public/test/test_renderer_host.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 chrome::HostDesktopType host_desktop_type, | 52 chrome::HostDesktopType host_desktop_type, |
| 52 bool hosted_app) | 53 bool hosted_app) |
| 53 : browser_type_(browser_type), | 54 : browser_type_(browser_type), |
| 54 host_desktop_type_(host_desktop_type), | 55 host_desktop_type_(host_desktop_type), |
| 55 hosted_app_(hosted_app) { | 56 hosted_app_(hosted_app) { |
| 56 } | 57 } |
| 57 | 58 |
| 58 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { | 59 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { |
| 59 } | 60 } |
| 60 | 61 |
| 62 void BrowserWithTestWindowTest::SetUpTestCase() { |
| 63 // Creating a browser requires platform parental controls initialization. |
| 64 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 65 } |
| 66 |
| 67 void BrowserWithTestWindowTest::TearDownTestCase() { |
| 68 IncognitoModePrefs::UninitializePlatformParentalControls(); |
| 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 |