| 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/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 if (browser_->window()->IsMaximized()) | 410 if (browser_->window()->IsMaximized()) |
| 411 browser_->window()->Restore(); | 411 browser_->window()->Restore(); |
| 412 #endif | 412 #endif |
| 413 content::WaitForLoadStop( | 413 content::WaitForLoadStop( |
| 414 browser_->tab_strip_model()->GetActiveWebContents()); | 414 browser_->tab_strip_model()->GetActiveWebContents()); |
| 415 } | 415 } |
| 416 | 416 |
| 417 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 417 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 418 // Do not use the real StorageMonitor for tests, which introduces another | 418 // Do not use the real StorageMonitor for tests, which introduces another |
| 419 // source of variability and potential slowness. | 419 // source of variability and potential slowness. |
| 420 ASSERT_TRUE(chrome::test::TestStorageMonitor::CreateForBrowserTests()); | 420 ASSERT_TRUE(TestStorageMonitor::CreateForBrowserTests()); |
| 421 #endif | 421 #endif |
| 422 | 422 |
| 423 // Pump any pending events that were created as a result of creating a | 423 // Pump any pending events that were created as a result of creating a |
| 424 // browser. | 424 // browser. |
| 425 content::RunAllPendingInMessageLoop(); | 425 content::RunAllPendingInMessageLoop(); |
| 426 | 426 |
| 427 SetUpOnMainThread(); | 427 SetUpOnMainThread(); |
| 428 #if defined(OS_MACOSX) | 428 #if defined(OS_MACOSX) |
| 429 autorelease_pool_->Recycle(); | 429 autorelease_pool_->Recycle(); |
| 430 #endif | 430 #endif |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // On the Mac, this eventually reaches | 478 // On the Mac, this eventually reaches |
| 479 // -[BrowserWindowController windowWillClose:], which will post a deferred | 479 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 480 // -autorelease on itself to ultimately destroy the Browser object. The line | 480 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 481 // below is necessary to pump these pending messages to ensure all Browsers | 481 // below is necessary to pump these pending messages to ensure all Browsers |
| 482 // get deleted. | 482 // get deleted. |
| 483 content::RunAllPendingInMessageLoop(); | 483 content::RunAllPendingInMessageLoop(); |
| 484 delete autorelease_pool_; | 484 delete autorelease_pool_; |
| 485 autorelease_pool_ = NULL; | 485 autorelease_pool_ = NULL; |
| 486 #endif | 486 #endif |
| 487 } | 487 } |
| OLD | NEW |