| 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/browser/chromeos/login/wizard_in_process_browser_test.h" | 5 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 9 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
| 10 #include "chrome/browser/chromeos/login/login_wizard.h" | 10 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 11 #include "chrome/browser/chromeos/login/wizard_controller.h" | 11 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
| 16 #include "chromeos/chromeos_switches.h" |
| 16 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| 20 WizardInProcessBrowserTest::WizardInProcessBrowserTest(const char* screen_name) | 21 WizardInProcessBrowserTest::WizardInProcessBrowserTest(const char* screen_name) |
| 21 : screen_name_(screen_name), | 22 : screen_name_(screen_name), |
| 22 host_(NULL) { | 23 host_(NULL) { |
| 23 } | 24 } |
| 24 | 25 |
| 25 void WizardInProcessBrowserTest::SetUp() { | 26 void WizardInProcessBrowserTest::SetUp() { |
| 26 WizardController::SetZeroDelays(); | 27 WizardController::SetZeroDelays(); |
| 27 InProcessBrowserTest::SetUp(); | 28 InProcessBrowserTest::SetUp(); |
| 28 } | 29 } |
| 29 | 30 |
| 30 void WizardInProcessBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 31 void WizardInProcessBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
| 31 command_line->AppendSwitch(switches::kNoStartupWindow); | 32 command_line->AppendSwitch(::switches::kNoStartupWindow); |
| 32 command_line->AppendSwitch(switches::kLoginManager); | 33 command_line->AppendSwitch(switches::kLoginManager); |
| 33 } | 34 } |
| 34 | 35 |
| 35 void WizardInProcessBrowserTest::SetUpOnMainThread() { | 36 void WizardInProcessBrowserTest::SetUpOnMainThread() { |
| 36 SetUpWizard(); | 37 SetUpWizard(); |
| 37 if (!screen_name_.empty()) { | 38 if (!screen_name_.empty()) { |
| 38 ShowLoginWizard(screen_name_, gfx::Size(1024, 600)); | 39 ShowLoginWizard(screen_name_, gfx::Size(1024, 600)); |
| 39 host_ = BaseLoginDisplayHost::default_host(); | 40 host_ = BaseLoginDisplayHost::default_host(); |
| 40 } | 41 } |
| 41 } | 42 } |
| 42 | 43 |
| 43 void WizardInProcessBrowserTest::CleanUpOnMainThread() { | 44 void WizardInProcessBrowserTest::CleanUpOnMainThread() { |
| 44 // LoginDisplayHost owns controllers and all windows. | 45 // LoginDisplayHost owns controllers and all windows. |
| 45 MessageLoopForUI::current()->DeleteSoon(FROM_HERE, host_); | 46 MessageLoopForUI::current()->DeleteSoon(FROM_HERE, host_); |
| 46 | 47 |
| 47 content::RunMessageLoop(); | 48 content::RunMessageLoop(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 } // namespace chromeos | 51 } // namespace chromeos |
| OLD | NEW |