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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 // TODO(jamescook): Windows Ash support. This will require refactoring | 53 // TODO(jamescook): Windows Ash support. This will require refactoring |
54 // AshTestHelper and AuraTestHelper so they can be used at the same time, | 54 // AshTestHelper and AuraTestHelper so they can be used at the same time, |
55 // perhaps by AshTestHelper owning an AuraTestHelper. | 55 // perhaps by AshTestHelper owning an AuraTestHelper. |
56 ash_test_helper_.reset(new ash::test::AshTestHelper( | 56 ash_test_helper_.reset(new ash::test::AshTestHelper( |
57 base::MessageLoopForUI::current())); | 57 base::MessageLoopForUI::current())); |
58 ash_test_helper_->SetUp(true); | 58 ash_test_helper_->SetUp(true); |
59 #elif defined(USE_AURA) | 59 #elif defined(USE_AURA) |
60 aura_test_helper_.reset(new aura::test::AuraTestHelper( | 60 aura_test_helper_.reset(new aura::test::AuraTestHelper( |
61 base::MessageLoopForUI::current())); | 61 base::MessageLoopForUI::current())); |
62 aura_test_helper_->SetUp(); | 62 bool allow_test_contexts = true; |
| 63 aura_test_helper_->SetUp(allow_test_contexts); |
63 #endif // USE_AURA | 64 #endif // USE_AURA |
64 #if defined(TOOLKIT_VIEWS) | 65 #if defined(TOOLKIT_VIEWS) |
65 views_delegate_.reset(CreateViewsDelegate()); | 66 views_delegate_.reset(CreateViewsDelegate()); |
66 views::ViewsDelegate::views_delegate = views_delegate_.get(); | 67 views::ViewsDelegate::views_delegate = views_delegate_.get(); |
67 #endif | 68 #endif |
68 | 69 |
69 // Subclasses can provide their own Profile. | 70 // Subclasses can provide their own Profile. |
70 profile_ = CreateProfile(); | 71 profile_ = CreateProfile(); |
71 // Subclasses can provide their own test BrowserWindow. If they return NULL | 72 // Subclasses can provide their own test BrowserWindow. If they return NULL |
72 // then Browser will create the a production BrowserWindow and the subclass | 73 // then Browser will create the a production BrowserWindow and the subclass |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 Browser::CreateParams params(profile, host_desktop_type); | 215 Browser::CreateParams params(profile, host_desktop_type); |
215 params.window = browser_window; | 216 params.window = browser_window; |
216 return new Browser(params); | 217 return new Browser(params); |
217 } | 218 } |
218 | 219 |
219 #if defined(TOOLKIT_VIEWS) | 220 #if defined(TOOLKIT_VIEWS) |
220 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { | 221 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { |
221 return new views::TestViewsDelegate; | 222 return new views::TestViewsDelegate; |
222 } | 223 } |
223 #endif | 224 #endif |
OLD | NEW |