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 return static_cast<WebUILoginDisplay*>( |
56 chromeos::ExistingUserController::current_controller(); | 56 ExistingUserController::current_controller()->login_display()); |
57 CHECK(controller); | |
58 return static_cast<chromeos::WebUILoginDisplay*>( | |
59 controller->login_display()); | |
60 } | 57 } |
61 | 58 |
62 views::Widget* GetLoginWindowWidget() { | 59 views::Widget* GetLoginWindowWidget() { |
63 return static_cast<chromeos::LoginDisplayHostImpl*>( | 60 return static_cast<LoginDisplayHostImpl*>(LoginDisplayHost::default_host()) |
64 chromeos::LoginDisplayHostImpl::default_host()) | |
65 ->login_window_for_test(); | 61 ->login_window_for_test(); |
66 } | 62 } |
67 | 63 |
68 private: | 64 private: |
69 DISALLOW_COPY_AND_ASSIGN(OobeTest); | 65 DISALLOW_COPY_AND_ASSIGN(OobeTest); |
70 }; | 66 }; |
71 | 67 |
72 IN_PROC_BROWSER_TEST_F(OobeTest, NewUser) { | 68 IN_PROC_BROWSER_TEST_F(OobeTest, NewUser) { |
73 WaitForGaiaPageLoad(); | 69 WaitForGaiaPageLoad(); |
74 | 70 |
(...skipping 15 matching lines...) Expand all Loading... |
90 ui_controls::SendKeyPress(login_window, | 86 ui_controls::SendKeyPress(login_window, |
91 ui::VKEY_E, | 87 ui::VKEY_E, |
92 true, // control | 88 true, // control |
93 false, // shift | 89 false, // shift |
94 true, // alt | 90 true, // alt |
95 false); // command | 91 false); // command |
96 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); | 92 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); |
97 } | 93 } |
98 | 94 |
99 } // namespace chromeos | 95 } // namespace chromeos |
OLD | NEW |