| OLD | NEW |
| 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/oobe_base_test.h" | 5 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 63 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void OobeBaseTest::SetUpOnMainThread() { | 66 void OobeBaseTest::SetUpOnMainThread() { |
| 67 // Restart the thread as the sandbox host process has already been spawned. | 67 // Restart the thread as the sandbox host process has already been spawned. |
| 68 embedded_test_server()->RestartThreadAndListen(); | 68 embedded_test_server()->RestartThreadAndListen(); |
| 69 | 69 |
| 70 ExtensionApiTest::SetUpOnMainThread(); | 70 ExtensionApiTest::SetUpOnMainThread(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void OobeBaseTest::CleanUpOnMainThread() { | 73 void OobeBaseTest::TearDownOnMainThread() { |
| 74 // If the login display is still showing, exit gracefully. | 74 // If the login display is still showing, exit gracefully. |
| 75 if (LoginDisplayHostImpl::default_host()) { | 75 if (LoginDisplayHostImpl::default_host()) { |
| 76 base::MessageLoop::current()->PostTask(FROM_HERE, | 76 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 77 base::Bind(&chrome::AttemptExit)); | 77 base::Bind(&chrome::AttemptExit)); |
| 78 content::RunMessageLoop(); | 78 content::RunMessageLoop(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 ExtensionApiTest::CleanUpOnMainThread(); | 81 ExtensionApiTest::TearDownOnMainThread(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void OobeBaseTest::SetUpCommandLine(CommandLine* command_line) { | 84 void OobeBaseTest::SetUpCommandLine(CommandLine* command_line) { |
| 85 ExtensionApiTest::SetUpCommandLine(command_line); | 85 ExtensionApiTest::SetUpCommandLine(command_line); |
| 86 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 86 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
| 87 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | 87 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); |
| 88 if (!needs_background_networking_) | 88 if (!needs_background_networking_) |
| 89 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); | 89 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); |
| 90 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 90 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
| 91 | 91 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { | 172 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { |
| 173 ExistingUserController* controller = | 173 ExistingUserController* controller = |
| 174 ExistingUserController::current_controller(); | 174 ExistingUserController::current_controller(); |
| 175 CHECK(controller); | 175 CHECK(controller); |
| 176 return static_cast<WebUILoginDisplay*>( | 176 return static_cast<WebUILoginDisplay*>( |
| 177 controller->login_display()); | 177 controller->login_display()); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace chromeos | 180 } // namespace chromeos |
| OLD | NEW |