| 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 12 matching lines...) Expand all Loading... |
| 23 #include "ui/base/test/ui_controls.h" | 23 #include "ui/base/test/ui_controls.h" |
| 24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 25 | 25 |
| 26 using namespace net::test_server; | 26 using namespace net::test_server; |
| 27 | 27 |
| 28 namespace chromeos { | 28 namespace chromeos { |
| 29 | 29 |
| 30 class OobeTest : public InProcessBrowserTest { | 30 class OobeTest : public InProcessBrowserTest { |
| 31 public: | 31 public: |
| 32 OobeTest() {} | 32 OobeTest() {} |
| 33 virtual ~OobeTest() {} | 33 ~OobeTest() override {} |
| 34 | 34 |
| 35 virtual void SetUpCommandLine(base::CommandLine* command_line) override { | 35 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 36 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 36 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
| 37 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | 37 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); |
| 38 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 38 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
| 39 command_line->AppendSwitchASCII( | 39 command_line->AppendSwitchASCII( |
| 40 ::switches::kAuthExtensionPath, "gaia_auth"); | 40 ::switches::kAuthExtensionPath, "gaia_auth"); |
| 41 fake_gaia_.Initialize(); | 41 fake_gaia_.Initialize(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 virtual void SetUpOnMainThread() override { | 44 void SetUpOnMainThread() override { |
| 45 CHECK(embedded_test_server()->InitializeAndWaitUntilReady()); | 45 CHECK(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 46 embedded_test_server()->RegisterRequestHandler( | 46 embedded_test_server()->RegisterRequestHandler( |
| 47 base::Bind(&FakeGaia::HandleRequest, base::Unretained(&fake_gaia_))); | 47 base::Bind(&FakeGaia::HandleRequest, base::Unretained(&fake_gaia_))); |
| 48 LOG(INFO) << "Set up http server at " << embedded_test_server()->base_url(); | 48 LOG(INFO) << "Set up http server at " << embedded_test_server()->base_url(); |
| 49 | 49 |
| 50 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 50 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 51 ::switches::kGaiaUrl, embedded_test_server()->base_url().spec()); | 51 ::switches::kGaiaUrl, embedded_test_server()->base_url().spec()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual void TearDownOnMainThread() override { | 54 void TearDownOnMainThread() override { |
| 55 // If the login display is still showing, exit gracefully. | 55 // If the login display is still showing, exit gracefully. |
| 56 if (LoginDisplayHostImpl::default_host()) { | 56 if (LoginDisplayHostImpl::default_host()) { |
| 57 base::MessageLoop::current()->PostTask(FROM_HERE, | 57 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 58 base::Bind(&chrome::AttemptExit)); | 58 base::Bind(&chrome::AttemptExit)); |
| 59 content::RunMessageLoop(); | 59 content::RunMessageLoop(); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 chromeos::WebUILoginDisplay* GetLoginDisplay() { | 63 chromeos::WebUILoginDisplay* GetLoginDisplay() { |
| 64 chromeos::ExistingUserController* controller = | 64 chromeos::ExistingUserController* controller = |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 ui_controls::SendKeyPress(login_window, | 115 ui_controls::SendKeyPress(login_window, |
| 116 ui::VKEY_E, | 116 ui::VKEY_E, |
| 117 true, // control | 117 true, // control |
| 118 false, // shift | 118 false, // shift |
| 119 true, // alt | 119 true, // alt |
| 120 false); // command | 120 false); // command |
| 121 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); | 121 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_ENROLLMENT).Wait(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace chromeos | 124 } // namespace chromeos |
| OLD | NEW |