| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 // Pump startup related events. | 342 // Pump startup related events. |
| 343 ui_test_utils::RunAllPendingInMessageLoop(); | 343 ui_test_utils::RunAllPendingInMessageLoop(); |
| 344 | 344 |
| 345 #if defined(OS_MACOSX) | 345 #if defined(OS_MACOSX) |
| 346 autorelease_pool_->Recycle(); | 346 autorelease_pool_->Recycle(); |
| 347 #endif | 347 #endif |
| 348 | 348 |
| 349 if (!BrowserList::empty()) { | 349 if (!BrowserList::empty()) { |
| 350 browser_ = *BrowserList::begin(); | 350 browser_ = *BrowserList::begin(); |
| 351 ui_test_utils::WaitForLoadStop(browser_->GetSelectedWebContents()); | 351 ui_test_utils::WaitForLoadStop(browser_->GetActiveWebContents()); |
| 352 } | 352 } |
| 353 | 353 |
| 354 // Pump any pending events that were created as a result of creating a | 354 // Pump any pending events that were created as a result of creating a |
| 355 // browser. | 355 // browser. |
| 356 ui_test_utils::RunAllPendingInMessageLoop(); | 356 ui_test_utils::RunAllPendingInMessageLoop(); |
| 357 | 357 |
| 358 SetUpOnMainThread(); | 358 SetUpOnMainThread(); |
| 359 #if defined(OS_MACOSX) | 359 #if defined(OS_MACOSX) |
| 360 autorelease_pool_->Recycle(); | 360 autorelease_pool_->Recycle(); |
| 361 #endif | 361 #endif |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 // On the Mac, this eventually reaches | 396 // On the Mac, this eventually reaches |
| 397 // -[BrowserWindowController windowWillClose:], which will post a deferred | 397 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 398 // -autorelease on itself to ultimately destroy the Browser object. The line | 398 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 399 // below is necessary to pump these pending messages to ensure all Browsers | 399 // below is necessary to pump these pending messages to ensure all Browsers |
| 400 // get deleted. | 400 // get deleted. |
| 401 ui_test_utils::RunAllPendingInMessageLoop(); | 401 ui_test_utils::RunAllPendingInMessageLoop(); |
| 402 delete autorelease_pool_; | 402 delete autorelease_pool_; |
| 403 autorelease_pool_ = NULL; | 403 autorelease_pool_ = NULL; |
| 404 #endif | 404 #endif |
| 405 } | 405 } |
| OLD | NEW |