| 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 15 matching lines...) Expand all Loading... |
| 26 using content::NavigationController; | 26 using content::NavigationController; |
| 27 using content::RenderViewHost; | 27 using content::RenderViewHost; |
| 28 using content::RenderViewHostTester; | 28 using content::RenderViewHostTester; |
| 29 using content::WebContents; | 29 using content::WebContents; |
| 30 | 30 |
| 31 BrowserWithTestWindowTest::BrowserWithTestWindowTest() | 31 BrowserWithTestWindowTest::BrowserWithTestWindowTest() |
| 32 : ui_thread_(BrowserThread::UI, message_loop()), | 32 : ui_thread_(BrowserThread::UI, message_loop()), |
| 33 db_thread_(BrowserThread::DB), | 33 db_thread_(BrowserThread::DB), |
| 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 io_thread_(BrowserThread::IO, message_loop()) { |
| 37 db_thread_.Start(); | 38 db_thread_.Start(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void BrowserWithTestWindowTest::SetUp() { | 41 void BrowserWithTestWindowTest::SetUp() { |
| 41 testing::Test::SetUp(); | 42 testing::Test::SetUp(); |
| 42 | 43 |
| 43 set_profile(CreateProfile()); | 44 set_profile(CreateProfile()); |
| 44 browser_.reset(new Browser(Browser::TYPE_TABBED, profile())); | 45 browser_.reset(new Browser(Browser::TYPE_TABBED, profile())); |
| 45 window_.reset(new TestBrowserWindow(browser())); | 46 window_.reset(new TestBrowserWindow(browser())); |
| 46 browser_->SetWindowForTesting(window_.get()); | 47 browser_->SetWindowForTesting(window_.get()); |
| (...skipping 106 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 |