| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/in_process_browser_test.h" | 5 #include "chrome/test/in_process_browser_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/ui/views/frame/browser_frame_win.h" | 50 #include "chrome/browser/ui/views/frame/browser_frame_win.h" |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 54 #include "chrome/browser/chromeos/audio_handler.h" | 54 #include "chrome/browser/chromeos/audio_handler.h" |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 namespace { | 57 namespace { |
| 58 | 58 |
| 59 void InitializeBrowser(Browser* browser) { | 59 void InitializeBrowser(Browser* browser) { |
| 60 ui_test_utils::WindowedNotificationObserver observer( |
| 61 content::NOTIFICATION_LOAD_STOP, |
| 62 NotificationService::AllSources()); |
| 60 browser->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), | 63 browser->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), |
| 61 PageTransition::START_PAGE); | 64 PageTransition::START_PAGE); |
| 62 | |
| 63 // Wait for the page to finish loading. | 65 // Wait for the page to finish loading. |
| 64 ui_test_utils::WaitForNavigation( | 66 observer.Wait(); |
| 65 &browser->GetSelectedTabContents()->controller()); | |
| 66 | |
| 67 browser->window()->Show(); | 67 browser->window()->Show(); |
| 68 } | 68 } |
| 69 | |
| 70 } // namespace | 69 } // namespace |
| 71 | 70 |
| 72 extern int BrowserMain(const MainFunctionParams&); | 71 extern int BrowserMain(const MainFunctionParams&); |
| 73 | 72 |
| 74 const char kUnitTestShowWindows[] = "show-windows"; | 73 const char kUnitTestShowWindows[] = "show-windows"; |
| 75 | 74 |
| 76 // Passed as value of kTestType. | 75 // Passed as value of kTestType. |
| 77 static const char kBrowserTestType[] = "browser"; | 76 static const char kBrowserTestType[] = "browser"; |
| 78 | 77 |
| 79 InProcessBrowserTest::InProcessBrowserTest() | 78 InProcessBrowserTest::InProcessBrowserTest() |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 return; | 352 return; |
| 354 | 353 |
| 355 // Invoke CloseAllBrowsersAndMayExit on a running message loop. | 354 // Invoke CloseAllBrowsersAndMayExit on a running message loop. |
| 356 // CloseAllBrowsersAndMayExit exits the message loop after everything has been | 355 // CloseAllBrowsersAndMayExit exits the message loop after everything has been |
| 357 // shut down properly. | 356 // shut down properly. |
| 358 MessageLoopForUI::current()->PostTask( | 357 MessageLoopForUI::current()->PostTask( |
| 359 FROM_HERE, | 358 FROM_HERE, |
| 360 NewRunnableFunction(&BrowserList::AttemptExit)); | 359 NewRunnableFunction(&BrowserList::AttemptExit)); |
| 361 ui_test_utils::RunMessageLoop(); | 360 ui_test_utils::RunMessageLoop(); |
| 362 } | 361 } |
| OLD | NEW |