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/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "chrome/browser/profiles/profile_destroyer.h" | 8 #include "chrome/browser/profiles/profile_destroyer.h" |
9 #include "chrome/browser/ui/browser_navigator.h" | 9 #include "chrome/browser/ui/browser_navigator.h" |
10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 file_thread_(BrowserThread::FILE, message_loop()), | 34 file_thread_(BrowserThread::FILE, message_loop()), |
35 file_user_blocking_thread_( | 35 file_user_blocking_thread_( |
36 BrowserThread::FILE_USER_BLOCKING, message_loop()) { | 36 BrowserThread::FILE_USER_BLOCKING, message_loop()) { |
37 db_thread_.Start(); | 37 db_thread_.Start(); |
38 } | 38 } |
39 | 39 |
40 void BrowserWithTestWindowTest::SetUp() { | 40 void BrowserWithTestWindowTest::SetUp() { |
41 testing::Test::SetUp(); | 41 testing::Test::SetUp(); |
42 | 42 |
43 set_profile(CreateProfile()); | 43 set_profile(CreateProfile()); |
44 browser_.reset(new Browser(Browser::TYPE_TABBED, profile())); | 44 window_.reset(new TestBrowserWindow); |
45 window_.reset(new TestBrowserWindow(browser())); | 45 Browser::CreateParams params(profile()); |
46 browser_->SetWindowForTesting(window_.get()); | 46 params.window = window_.get(); |
| 47 browser_.reset(new Browser(params)); |
47 #if defined(USE_AURA) | 48 #if defined(USE_AURA) |
48 aura_test_helper_.reset(new aura::test::AuraTestHelper(&ui_loop_)); | 49 aura_test_helper_.reset(new aura::test::AuraTestHelper(&ui_loop_)); |
49 aura_test_helper_->SetUp(); | 50 aura_test_helper_->SetUp(); |
50 #endif // USE_AURA | 51 #endif // USE_AURA |
51 } | 52 } |
52 | 53 |
53 void BrowserWithTestWindowTest::TearDown() { | 54 void BrowserWithTestWindowTest::TearDown() { |
54 testing::Test::TearDown(); | 55 testing::Test::TearDown(); |
55 #if defined(USE_AURA) | 56 #if defined(USE_AURA) |
56 aura_test_helper_->TearDown(); | 57 aura_test_helper_->TearDown(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Destroy the profile here - otherwise, if the profile is freed in the | 154 // Destroy the profile here - otherwise, if the profile is freed in the |
154 // destructor, and a test subclass owns a resource that the profile depends | 155 // destructor, and a test subclass owns a resource that the profile depends |
155 // on (such as g_browser_process()->local_state()) there's no way for the | 156 // on (such as g_browser_process()->local_state()) there's no way for the |
156 // subclass to free it after the profile. | 157 // subclass to free it after the profile. |
157 profile_.reset(NULL); | 158 profile_.reset(NULL); |
158 } | 159 } |
159 | 160 |
160 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { | 161 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { |
161 return new TestingProfile(); | 162 return new TestingProfile(); |
162 } | 163 } |
OLD | NEW |