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/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 } | 197 } |
198 return test_launcher_utils::OverrideUserDataDir(user_data_dir); | 198 return test_launcher_utils::OverrideUserDataDir(user_data_dir); |
199 } | 199 } |
200 | 200 |
201 void InProcessBrowserTest::TearDown() { | 201 void InProcessBrowserTest::TearDown() { |
202 DCHECK(!g_browser_process); | 202 DCHECK(!g_browser_process); |
203 BrowserTestBase::TearDown(); | 203 BrowserTestBase::TearDown(); |
204 } | 204 } |
205 | 205 |
| 206 content::BrowserContext* InProcessBrowserTest::GetBrowserContext() { |
| 207 return browser_->profile(); |
| 208 } |
| 209 |
206 content::ResourceContext* InProcessBrowserTest::GetResourceContext() { | 210 content::ResourceContext* InProcessBrowserTest::GetResourceContext() { |
207 return browser_->profile()->GetResourceContext(); | 211 return browser_->profile()->GetResourceContext(); |
208 } | 212 } |
209 | 213 |
210 void InProcessBrowserTest::AddTabAtIndexToBrowser( | 214 void InProcessBrowserTest::AddTabAtIndexToBrowser( |
211 Browser* browser, | 215 Browser* browser, |
212 int index, | 216 int index, |
213 const GURL& url, | 217 const GURL& url, |
214 content::PageTransition transition) { | 218 content::PageTransition transition) { |
215 browser::NavigateParams params(browser, url, transition); | 219 browser::NavigateParams params(browser, url, transition); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 if (BrowserList::size() == 0) | 352 if (BrowserList::size() == 0) |
349 return; | 353 return; |
350 | 354 |
351 // Invoke CloseAllBrowsersAndMayExit on a running message loop. | 355 // Invoke CloseAllBrowsersAndMayExit on a running message loop. |
352 // CloseAllBrowsersAndMayExit exits the message loop after everything has been | 356 // CloseAllBrowsersAndMayExit exits the message loop after everything has been |
353 // shut down properly. | 357 // shut down properly. |
354 MessageLoopForUI::current()->PostTask(FROM_HERE, | 358 MessageLoopForUI::current()->PostTask(FROM_HERE, |
355 base::Bind(&BrowserList::AttemptExit)); | 359 base::Bind(&BrowserList::AttemptExit)); |
356 ui_test_utils::RunMessageLoop(); | 360 ui_test_utils::RunMessageLoop(); |
357 } | 361 } |
OLD | NEW |