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