Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: chrome/browser/chromeos/login/test/wizard_in_process_browser_test.cc

Issue 2566443005: cros: Replace WizardController string constants with OobeScreen values. (Closed)
Patch Set: Initial upload Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/wizard_in_process_browser_test.h" 5 #include "chrome/browser/chromeos/login/test/wizard_in_process_browser_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "base/threading/thread_task_runner_handle.h" 12 #include "base/threading/thread_task_runner_handle.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/chromeos/login/login_wizard.h" 14 #include "chrome/browser/chromeos/login/login_wizard.h"
15 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 15 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
16 #include "chrome/browser/chromeos/login/wizard_controller.h" 16 #include "chrome/browser/chromeos/login/wizard_controller.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
19 #include "chromeos/chromeos_switches.h" 19 #include "chromeos/chromeos_switches.h"
20 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
21 21
22 namespace chromeos { 22 namespace chromeos {
23 23
24 WizardInProcessBrowserTest::WizardInProcessBrowserTest(const char* screen_name) 24 WizardInProcessBrowserTest::WizardInProcessBrowserTest(OobeScreen screen)
25 : screen_name_(screen_name), 25 : screen_(screen) {}
26 host_(NULL) {
27 }
28 26
29 void WizardInProcessBrowserTest::SetUp() { 27 void WizardInProcessBrowserTest::SetUp() {
30 WizardController::SetZeroDelays(); 28 WizardController::SetZeroDelays();
31 InProcessBrowserTest::SetUp(); 29 InProcessBrowserTest::SetUp();
32 } 30 }
33 31
34 void WizardInProcessBrowserTest::SetUpCommandLine( 32 void WizardInProcessBrowserTest::SetUpCommandLine(
35 base::CommandLine* command_line) { 33 base::CommandLine* command_line) {
36 command_line->AppendSwitch(::switches::kNoStartupWindow); 34 command_line->AppendSwitch(::switches::kNoStartupWindow);
37 command_line->AppendSwitch(switches::kLoginManager); 35 command_line->AppendSwitch(switches::kLoginManager);
38 } 36 }
39 37
40 void WizardInProcessBrowserTest::SetUpOnMainThread() { 38 void WizardInProcessBrowserTest::SetUpOnMainThread() {
41 SetUpWizard(); 39 SetUpWizard();
42 if (!screen_name_.empty()) { 40 if (screen_ != OobeScreen::SCREEN_UNKNOWN) {
43 ShowLoginWizard(screen_name_); 41 ShowLoginWizard(screen_);
44 host_ = LoginDisplayHost::default_host(); 42 host_ = LoginDisplayHost::default_host();
45 } 43 }
46 } 44 }
47 45
48 void WizardInProcessBrowserTest::TearDownOnMainThread() { 46 void WizardInProcessBrowserTest::TearDownOnMainThread() {
49 ASSERT_TRUE(base::MessageLoopForUI::IsCurrent()); 47 ASSERT_TRUE(base::MessageLoopForUI::IsCurrent());
50 48
51 // LoginDisplayHost owns controllers and all windows. 49 // LoginDisplayHost owns controllers and all windows.
52 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_); 50 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_);
53 base::RunLoop().RunUntilIdle(); 51 base::RunLoop().RunUntilIdle();
54 } 52 }
55 53
56 } // namespace chromeos 54 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698