OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
7 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 7 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
8 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 8 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
9 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 9 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
10 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 10 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return static_cast<chromeos::LoginDisplayHostImpl*>( | 72 return static_cast<chromeos::LoginDisplayHostImpl*>( |
73 chromeos::LoginDisplayHostImpl::default_host()) | 73 chromeos::LoginDisplayHostImpl::default_host()) |
74 ->login_window_for_test(); | 74 ->login_window_for_test(); |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 FakeGaia fake_gaia_; | 78 FakeGaia fake_gaia_; |
79 DISALLOW_COPY_AND_ASSIGN(OobeTest); | 79 DISALLOW_COPY_AND_ASSIGN(OobeTest); |
80 }; | 80 }; |
81 | 81 |
82 #if defined(OS_CHROMEOS) | 82 IN_PROC_BROWSER_TEST_F(OobeTest, NewUser) { |
83 #define MAYBE_NewUser DISABLED_NewUser | |
84 #else | |
85 #define MAYBE_NewUser NewUser | |
86 #endif | |
87 IN_PROC_BROWSER_TEST_F(OobeTest, MAYBE_NewUser) { | |
88 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 83 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
89 chromeos::WizardController* wizard_controller = | 84 chromeos::WizardController* wizard_controller = |
90 chromeos::WizardController::default_controller(); | 85 chromeos::WizardController::default_controller(); |
91 CHECK(wizard_controller); | 86 CHECK(wizard_controller); |
92 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 87 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
93 | 88 |
94 content::WindowedNotificationObserver( | 89 content::WindowedNotificationObserver( |
95 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 90 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
96 content::NotificationService::AllSources()).Wait(); | 91 content::NotificationService::AllSources()).Wait(); |
97 | 92 |
98 // TODO(glotov): mock GAIA server (test_server()) should support | 93 // TODO(glotov): mock GAIA server (test_server()) should support |
99 // username/password configuration. | 94 // username/password configuration. |
100 GetLoginDisplay()->ShowSigninScreenForCreds("username", "password"); | 95 GetLoginDisplay()->ShowSigninScreenForCreds("username", "password"); |
101 | 96 |
102 content::WindowedNotificationObserver( | 97 content::WindowedNotificationObserver( |
103 chrome::NOTIFICATION_SESSION_STARTED, | 98 chrome::NOTIFICATION_SESSION_STARTED, |
104 content::NotificationService::AllSources()).Wait(); | 99 content::NotificationService::AllSources()).Wait(); |
105 } | 100 } |
106 | 101 |
107 #if defined(OS_CHROMEOS) | 102 IN_PROC_BROWSER_TEST_F(OobeTest, Accelerator) { |
108 #define MAYBE_Accelerator DISABLED_Accelerator | |
109 #else | |
110 #define MAYBE_Accelerator Accelerator | |
111 #endif | |
112 IN_PROC_BROWSER_TEST_F(OobeTest, MAYBE_Accelerator) { | |
113 chromeos::WizardController::SkipPostLoginScreensForTesting(); | 103 chromeos::WizardController::SkipPostLoginScreensForTesting(); |
114 chromeos::WizardController* wizard_controller = | 104 chromeos::WizardController* wizard_controller = |
115 chromeos::WizardController::default_controller(); | 105 chromeos::WizardController::default_controller(); |
116 CHECK(wizard_controller); | 106 CHECK(wizard_controller); |
117 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 107 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
118 | 108 |
119 content::WindowedNotificationObserver( | 109 content::WindowedNotificationObserver( |
120 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 110 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
121 content::NotificationService::AllSources()).Wait(); | 111 content::NotificationService::AllSources()).Wait(); |
122 | 112 |
123 gfx::NativeWindow login_window = GetLoginWindowWidget()->GetNativeWindow(); | 113 gfx::NativeWindow login_window = GetLoginWindowWidget()->GetNativeWindow(); |
124 | 114 |
125 ui_controls::SendKeyPress(login_window, | 115 ui_controls::SendKeyPress(login_window, |
126 ui::VKEY_E, | 116 ui::VKEY_E, |
127 true, // control | 117 true, // control |
128 false, // shift | 118 false, // shift |
129 true, // alt | 119 true, // alt |
130 false); // command | 120 false); // command |
131 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); | 121 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); |
132 } | 122 } |
133 | 123 |
134 } // namespace chromeos | 124 } // namespace chromeos |
OLD | NEW |