| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 for (base::CommandLine::SwitchMap::const_iterator iter = switches.begin(); | 531 for (base::CommandLine::SwitchMap::const_iterator iter = switches.begin(); |
| 532 iter != switches.end(); ++iter) { | 532 iter != switches.end(); ++iter) { |
| 533 new_command_line.AppendSwitchNative((*iter).first, (*iter).second); | 533 new_command_line.AppendSwitchNative((*iter).first, (*iter).second); |
| 534 } | 534 } |
| 535 return new_command_line; | 535 return new_command_line; |
| 536 } | 536 } |
| 537 #endif | 537 #endif |
| 538 | 538 |
| 539 void InProcessBrowserTest::RunTestOnMainThreadLoop() { | 539 void InProcessBrowserTest::RunTestOnMainThreadLoop() { |
| 540 AfterStartupTaskUtils::SetBrowserStartupIsComplete(); | 540 AfterStartupTaskUtils::SetBrowserStartupIsCompleteForTesting(); |
| 541 | 541 |
| 542 // Pump startup related events. | 542 // Pump startup related events. |
| 543 content::RunAllPendingInMessageLoop(); | 543 content::RunAllPendingInMessageLoop(); |
| 544 | 544 |
| 545 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); | 545 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); |
| 546 // Self-adds/removes itself from the BrowserList observers. | 546 // Self-adds/removes itself from the BrowserList observers. |
| 547 scoped_ptr<SingleDesktopTestObserver> single_desktop_test_observer; | 547 scoped_ptr<SingleDesktopTestObserver> single_desktop_test_observer; |
| 548 if (!multi_desktop_test_) { | 548 if (!multi_desktop_test_) { |
| 549 single_desktop_test_observer.reset( | 549 single_desktop_test_observer.reset( |
| 550 new SingleDesktopTestObserver(active_desktop)); | 550 new SingleDesktopTestObserver(active_desktop)); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 // On the Mac, this eventually reaches | 649 // On the Mac, this eventually reaches |
| 650 // -[BrowserWindowController windowWillClose:], which will post a deferred | 650 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 651 // -autorelease on itself to ultimately destroy the Browser object. The line | 651 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 652 // below is necessary to pump these pending messages to ensure all Browsers | 652 // below is necessary to pump these pending messages to ensure all Browsers |
| 653 // get deleted. | 653 // get deleted. |
| 654 content::RunAllPendingInMessageLoop(); | 654 content::RunAllPendingInMessageLoop(); |
| 655 delete autorelease_pool_; | 655 delete autorelease_pool_; |
| 656 autorelease_pool_ = NULL; | 656 autorelease_pool_ = NULL; |
| 657 #endif | 657 #endif |
| 658 } | 658 } |
| OLD | NEW |