Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/chromeos/login/login_utils_browsertest.cc

Issue 10918027: Revert 154457 - Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/scoped_temp_dir.h" 11 #include "base/scoped_temp_dir.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/threading/sequenced_worker_pool.h" 13 #include "base/threading/sequenced_worker_pool.h"
14 #include "chrome/browser/chromeos/cros/cros_library.h" 14 #include "chrome/browser/chromeos/cros/cros_library.h"
15 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" 15 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h"
16 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" 16 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
17 #include "chrome/browser/chromeos/login/authenticator.h" 17 #include "chrome/browser/chromeos/login/authenticator.h"
18 #include "chrome/browser/chromeos/login/login_status_consumer.h" 18 #include "chrome/browser/chromeos/login/login_status_consumer.h"
19 #include "chrome/browser/chromeos/login/user_manager.h" 19 #include "chrome/browser/chromeos/login/user_manager.h"
20 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
21 #include "chrome/browser/io_thread.h" 20 #include "chrome/browser/io_thread.h"
22 #include "chrome/browser/net/predictor.h" 21 #include "chrome/browser/net/predictor.h"
23 #include "chrome/browser/policy/browser_policy_connector.h" 22 #include "chrome/browser/policy/browser_policy_connector.h"
24 #include "chrome/browser/policy/cloud_policy_data_store.h" 23 #include "chrome/browser/policy/cloud_policy_data_store.h"
25 #include "chrome/browser/policy/proto/device_management_backend.pb.h" 24 #include "chrome/browser/policy/proto/device_management_backend.pb.h"
26 #include "chrome/browser/profiles/profile_manager.h" 25 #include "chrome/browser/profiles/profile_manager.h"
27 #include "chrome/common/chrome_paths.h" 26 #include "chrome/common/chrome_paths.h"
28 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
29 #include "chrome/common/net/gaia/gaia_auth_consumer.h" 28 #include "chrome/common/net/gaia/gaia_auth_consumer.h"
30 #include "chrome/common/net/gaia/gaia_urls.h" 29 #include "chrome/common/net/gaia/gaia_urls.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 policy::CloudPolicyDataStore* device_data_store = 280 policy::CloudPolicyDataStore* device_data_store =
282 connector_->GetDeviceCloudPolicyDataStore(); 281 connector_->GetDeviceCloudPolicyDataStore();
283 device_data_store->set_device_mode(policy::DEVICE_MODE_ENTERPRISE); 282 device_data_store->set_device_mode(policy::DEVICE_MODE_ENTERPRISE);
284 device_data_store->set_device_id(kDeviceId); 283 device_data_store->set_device_id(kDeviceId);
285 EXPECT_EQ(policy::EnterpriseInstallAttributes::LOCK_SUCCESS, 284 EXPECT_EQ(policy::EnterpriseInstallAttributes::LOCK_SUCCESS,
286 connector_->LockDevice(username)); 285 connector_->LockDevice(username));
287 RunAllPending(); 286 RunAllPending();
288 } 287 }
289 288
290 void PrepareProfile(const std::string& username) { 289 void PrepareProfile(const std::string& username) {
291 ScopedDeviceSettingsTestHelper device_settings_test_helper; 290 MockSessionManagerClient* session_managed_client =
292 MockSessionManagerClient* session_manager_client =
293 mock_dbus_thread_manager_.mock_session_manager_client(); 291 mock_dbus_thread_manager_.mock_session_manager_client();
294 EXPECT_CALL(*session_manager_client, StartSession(_)); 292 EXPECT_CALL(*session_managed_client, StartSession(_));
295 EXPECT_CALL(*cryptohome_, GetSystemSalt()) 293 EXPECT_CALL(*cryptohome_, GetSystemSalt())
296 .WillRepeatedly(Return(std::string("stub_system_salt"))); 294 .WillRepeatedly(Return(std::string("stub_system_salt")));
297 EXPECT_CALL(*mock_async_method_caller_, AsyncMount(_, _, _, _)) 295 EXPECT_CALL(*mock_async_method_caller_, AsyncMount(_, _, _, _))
298 .WillRepeatedly(Return()); 296 .WillRepeatedly(Return());
299 297
300 scoped_refptr<Authenticator> authenticator = 298 scoped_refptr<Authenticator> authenticator =
301 LoginUtils::Get()->CreateAuthenticator(this); 299 LoginUtils::Get()->CreateAuthenticator(this);
302 authenticator->CompleteLogin(ProfileManager::GetDefaultProfile(), 300 authenticator->CompleteLogin(ProfileManager::GetDefaultProfile(),
303 username, 301 username,
304 "password"); 302 "password");
305 303
306 LoginUtils::Get()->PrepareProfile(username, std::string(), "password", 304 LoginUtils::Get()->PrepareProfile(username, std::string(), "password",
307 false, true, false, this); 305 false, true, false, this);
308 device_settings_test_helper.Flush();
309 RunAllPending(); 306 RunAllPending();
310 } 307 }
311 308
312 net::TestURLFetcher* PrepareOAuthFetcher(const std::string& expected_url) { 309 net::TestURLFetcher* PrepareOAuthFetcher(const std::string& expected_url) {
313 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID(0); 310 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID(0);
314 EXPECT_TRUE(fetcher); 311 EXPECT_TRUE(fetcher);
315 EXPECT_TRUE(fetcher->delegate()); 312 EXPECT_TRUE(fetcher->delegate());
316 EXPECT_TRUE(StartsWithASCII(fetcher->GetOriginalURL().spec(), 313 EXPECT_TRUE(StartsWithASCII(fetcher->GetOriginalURL().spec(),
317 expected_url, 314 expected_url,
318 true)); 315 true));
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 511 }
515 512
516 INSTANTIATE_TEST_CASE_P( 513 INSTANTIATE_TEST_CASE_P(
517 LoginUtilsBlockingLoginTestInstance, 514 LoginUtilsBlockingLoginTestInstance,
518 LoginUtilsBlockingLoginTest, 515 LoginUtilsBlockingLoginTest,
519 testing::Values(0, 1, 2, 3, 4, 5)); 516 testing::Values(0, 1, 2, 3, 4, 5));
520 517
521 } // namespace 518 } // namespace
522 519
523 } 520 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/chromeos/login/parallel_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698