| 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/in_process_browser_test.h" | 5 #include "chrome/test/base/in_process_browser_test.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 return test_launcher_utils::OverrideUserDataDir(user_data_dir); | 204 return test_launcher_utils::OverrideUserDataDir(user_data_dir); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void InProcessBrowserTest::TearDown() { | 207 void InProcessBrowserTest::TearDown() { |
| 208 DCHECK(!g_browser_process); | 208 DCHECK(!g_browser_process); |
| 209 BrowserTestBase::TearDown(); | 209 BrowserTestBase::TearDown(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 content::BrowserContext* InProcessBrowserTest::GetBrowserContext() { | |
| 213 return browser_->profile(); | |
| 214 } | |
| 215 | |
| 216 content::ResourceContext* InProcessBrowserTest::GetResourceContext() { | |
| 217 return browser_->profile()->GetResourceContext(); | |
| 218 } | |
| 219 | |
| 220 void InProcessBrowserTest::AddTabAtIndexToBrowser( | 212 void InProcessBrowserTest::AddTabAtIndexToBrowser( |
| 221 Browser* browser, | 213 Browser* browser, |
| 222 int index, | 214 int index, |
| 223 const GURL& url, | 215 const GURL& url, |
| 224 content::PageTransition transition) { | 216 content::PageTransition transition) { |
| 225 chrome::NavigateParams params(browser, url, transition); | 217 chrome::NavigateParams params(browser, url, transition); |
| 226 params.tabstrip_index = index; | 218 params.tabstrip_index = index; |
| 227 params.disposition = NEW_FOREGROUND_TAB; | 219 params.disposition = NEW_FOREGROUND_TAB; |
| 228 chrome::Navigate(¶ms); | 220 chrome::Navigate(¶ms); |
| 229 } | 221 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // On the Mac, this eventually reaches | 371 // On the Mac, this eventually reaches |
| 380 // -[BrowserWindowController windowWillClose:], which will post a deferred | 372 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 381 // -autorelease on itself to ultimately destroy the Browser object. The line | 373 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 382 // below is necessary to pump these pending messages to ensure all Browsers | 374 // below is necessary to pump these pending messages to ensure all Browsers |
| 383 // get deleted. | 375 // get deleted. |
| 384 content::RunAllPendingInMessageLoop(); | 376 content::RunAllPendingInMessageLoop(); |
| 385 delete autorelease_pool_; | 377 delete autorelease_pool_; |
| 386 autorelease_pool_ = NULL; | 378 autorelease_pool_ = NULL; |
| 387 #endif | 379 #endif |
| 388 } | 380 } |
| OLD | NEW |