Chromium Code Reviews| 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 "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 8 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 9 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 9 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| 10 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 10 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 ~OobeTest() override {} | 35 ~OobeTest() override {} |
| 36 | 36 |
| 37 void SetUpCommandLine(base::CommandLine* command_line) override { | 37 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 38 command_line->AppendSwitch(switches::kOobeSkipPostLogin); | 38 command_line->AppendSwitch(switches::kOobeSkipPostLogin); |
| 39 | 39 |
| 40 OobeBaseTest::SetUpCommandLine(command_line); | 40 OobeBaseTest::SetUpCommandLine(command_line); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void TearDownOnMainThread() override { | 43 void TearDownOnMainThread() override { |
| 44 // If the login display is still showing, exit gracefully. | 44 // If the login display is still showing, exit gracefully. |
| 45 if (LoginDisplayHostImpl::default_host()) { | 45 if (LoginDisplayHost::default_host()) { |
| 46 base::MessageLoop::current()->PostTask(FROM_HERE, | 46 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 47 base::Bind(&chrome::AttemptExit)); | 47 base::Bind(&chrome::AttemptExit)); |
| 48 content::RunMessageLoop(); | 48 content::RunMessageLoop(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 OobeBaseTest::TearDownOnMainThread(); | 51 OobeBaseTest::TearDownOnMainThread(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 chromeos::WebUILoginDisplay* GetLoginDisplay() { | 54 WebUILoginDisplay* GetLoginDisplay() { |
| 55 chromeos::ExistingUserController* controller = | 55 ExistingUserController* controller = |
| 56 chromeos::ExistingUserController::current_controller(); | 56 ExistingUserController::current_controller(); |
| 57 CHECK(controller); | 57 CHECK(controller); |
|
achuithb
2016/01/22 22:37:08
nit: drop check since line below crashes
jdufault
2016/01/22 23:04:15
Done.
| |
| 58 return static_cast<chromeos::WebUILoginDisplay*>( | 58 return static_cast<WebUILoginDisplay*>(controller->login_display()); |
| 59 controller->login_display()); | |
| 60 } | 59 } |
| 61 | 60 |
| 62 views::Widget* GetLoginWindowWidget() { | 61 views::Widget* GetLoginWindowWidget() { |
| 63 return static_cast<chromeos::LoginDisplayHostImpl*>( | 62 return static_cast<LoginDisplayHostImpl*>(LoginDisplayHost::default_host()) |
| 64 chromeos::LoginDisplayHostImpl::default_host()) | |
| 65 ->login_window_for_test(); | 63 ->login_window_for_test(); |
| 66 } | 64 } |
| 67 | 65 |
| 68 private: | 66 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(OobeTest); | 67 DISALLOW_COPY_AND_ASSIGN(OobeTest); |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 IN_PROC_BROWSER_TEST_F(OobeTest, NewUser) { | 70 IN_PROC_BROWSER_TEST_F(OobeTest, NewUser) { |
| 73 WaitForGaiaPageLoad(); | 71 WaitForGaiaPageLoad(); |
| 74 | 72 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 90 ui_controls::SendKeyPress(login_window, | 88 ui_controls::SendKeyPress(login_window, |
| 91 ui::VKEY_E, | 89 ui::VKEY_E, |
| 92 true, // control | 90 true, // control |
| 93 false, // shift | 91 false, // shift |
| 94 true, // alt | 92 true, // alt |
| 95 false); // command | 93 false); // command |
| 96 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); | 94 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); |
| 97 } | 95 } |
| 98 | 96 |
| 99 } // namespace chromeos | 97 } // namespace chromeos |
| OLD | NEW |