| 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_util.h" | 10 #include "base/file_util.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 DCHECK(!g_browser_process); | 212 DCHECK(!g_browser_process); |
| 213 BrowserTestBase::TearDown(); | 213 BrowserTestBase::TearDown(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void InProcessBrowserTest::AddTabAtIndexToBrowser( | 216 void InProcessBrowserTest::AddTabAtIndexToBrowser( |
| 217 Browser* browser, | 217 Browser* browser, |
| 218 int index, | 218 int index, |
| 219 const GURL& url, | 219 const GURL& url, |
| 220 content::PageTransition transition) { | 220 content::PageTransition transition) { |
| 221 content::TestNavigationObserver observer( | 221 content::TestNavigationObserver observer( |
| 222 content::NotificationService::AllSources(), NULL, 1); | 222 content::NotificationService::AllSources(), 1); |
| 223 | 223 |
| 224 chrome::NavigateParams params(browser, url, transition); | 224 chrome::NavigateParams params(browser, url, transition); |
| 225 params.tabstrip_index = index; | 225 params.tabstrip_index = index; |
| 226 params.disposition = NEW_FOREGROUND_TAB; | 226 params.disposition = NEW_FOREGROUND_TAB; |
| 227 chrome::Navigate(¶ms); | 227 chrome::Navigate(¶ms); |
| 228 | 228 |
| 229 observer.Wait(); | 229 observer.Wait(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void InProcessBrowserTest::AddTabAtIndex( | 232 void InProcessBrowserTest::AddTabAtIndex( |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // On the Mac, this eventually reaches | 393 // On the Mac, this eventually reaches |
| 394 // -[BrowserWindowController windowWillClose:], which will post a deferred | 394 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 395 // -autorelease on itself to ultimately destroy the Browser object. The line | 395 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 396 // below is necessary to pump these pending messages to ensure all Browsers | 396 // below is necessary to pump these pending messages to ensure all Browsers |
| 397 // get deleted. | 397 // get deleted. |
| 398 content::RunAllPendingInMessageLoop(); | 398 content::RunAllPendingInMessageLoop(); |
| 399 delete autorelease_pool_; | 399 delete autorelease_pool_; |
| 400 autorelease_pool_ = NULL; | 400 autorelease_pool_ = NULL; |
| 401 #endif | 401 #endif |
| 402 } | 402 } |
| OLD | NEW |