OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/chromeos/login/login_manager_test.h" | 5 #include "chrome/browser/chromeos/login/login_manager_test.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 UserSessionManager::GetInstance()); | 148 UserSessionManager::GetInstance()); |
149 session_manager_test_api.SetShouldLaunchBrowserInTests( | 149 session_manager_test_api.SetShouldLaunchBrowserInTests( |
150 should_launch_browser_); | 150 should_launch_browser_); |
151 session_manager_test_api.SetShouldObtainTokenHandleInTests(false); | 151 session_manager_test_api.SetShouldObtainTokenHandleInTests(false); |
152 | 152 |
153 MixinBasedBrowserTest::SetUpOnMainThread(); | 153 MixinBasedBrowserTest::SetUpOnMainThread(); |
154 } | 154 } |
155 | 155 |
156 void LoginManagerTest::RegisterUser(const std::string& user_id) { | 156 void LoginManagerTest::RegisterUser(const std::string& user_id) { |
157 ListPrefUpdate users_pref(g_browser_process->local_state(), "LoggedInUsers"); | 157 ListPrefUpdate users_pref(g_browser_process->local_state(), "LoggedInUsers"); |
158 users_pref->AppendIfNotPresent(new base::StringValue(user_id)); | 158 users_pref->AppendIfNotPresent(base::MakeUnique<base::StringValue>(user_id)); |
159 } | 159 } |
160 | 160 |
161 void LoginManagerTest::SetExpectedCredentials(const UserContext& user_context) { | 161 void LoginManagerTest::SetExpectedCredentials(const UserContext& user_context) { |
162 test::UserSessionManagerTestApi session_manager_test_api( | 162 test::UserSessionManagerTestApi session_manager_test_api( |
163 UserSessionManager::GetInstance()); | 163 UserSessionManager::GetInstance()); |
164 session_manager_test_api.InjectStubUserContext(user_context); | 164 session_manager_test_api.InjectStubUserContext(user_context); |
165 } | 165 } |
166 | 166 |
167 bool LoginManagerTest::TryToLogin(const UserContext& user_context) { | 167 bool LoginManagerTest::TryToLogin(const UserContext& user_context) { |
168 if (!AddUserToSession(user_context)) | 168 if (!AddUserToSession(user_context)) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 EXPECT_TRUE(host != NULL); | 222 EXPECT_TRUE(host != NULL); |
223 | 223 |
224 content::WebContents* web_contents = | 224 content::WebContents* web_contents = |
225 host->GetWebUILoginView()->GetWebContents(); | 225 host->GetWebUILoginView()->GetWebContents(); |
226 EXPECT_TRUE(web_contents != NULL); | 226 EXPECT_TRUE(web_contents != NULL); |
227 set_web_contents(web_contents); | 227 set_web_contents(web_contents); |
228 js_checker_.set_web_contents(web_contents); | 228 js_checker_.set_web_contents(web_contents); |
229 } | 229 } |
230 | 230 |
231 } // namespace chromeos | 231 } // namespace chromeos |
OLD | NEW |