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

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_provider_unittest.cc

Issue 14927015: Translate device-local account IDs to user IDs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix forward declaration. Created 7 years, 7 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/settings/device_settings_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/test/scoped_path_override.h" 13 #include "base/test/scoped_path_override.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/chromeos/cros/cros_library.h" 15 #include "chrome/browser/chromeos/cros/cros_library.h"
16 #include "chrome/browser/chromeos/policy/device_local_account.h"
16 #include "chrome/browser/chromeos/settings/cros_settings_names.h" 17 #include "chrome/browser/chromeos/settings/cros_settings_names.h"
17 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" 18 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
18 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h" 19 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
19 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 20 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
20 #include "chrome/common/chrome_paths.h" 21 #include "chrome/common/chrome_paths.h"
21 #include "chrome/test/base/scoped_testing_local_state.h" 22 #include "chrome/test/base/scoped_testing_local_state.h"
22 #include "chrome/test/base/testing_browser_process.h" 23 #include "chrome/test/base/testing_browser_process.h"
23 #include "testing/gmock/include/gmock/gmock.h" 24 #include "testing/gmock/include/gmock/gmock.h"
24 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
25 26
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); 274 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob());
274 ReloadDeviceSettings(); 275 ReloadDeviceSettings();
275 Mock::VerifyAndClearExpectations(this); 276 Mock::VerifyAndClearExpectations(this);
276 277
277 // On load, the deprecated spec should have been converted to the new format. 278 // On load, the deprecated spec should have been converted to the new format.
278 base::ListValue expected_accounts; 279 base::ListValue expected_accounts;
279 scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue()); 280 scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue());
280 entry_dict->SetString(kAccountsPrefDeviceLocalAccountsKeyId, 281 entry_dict->SetString(kAccountsPrefDeviceLocalAccountsKeyId,
281 policy::PolicyBuilder::kFakeUsername); 282 policy::PolicyBuilder::kFakeUsername);
282 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType, 283 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType,
283 DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION); 284 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION);
284 expected_accounts.Append(entry_dict.release()); 285 expected_accounts.Append(entry_dict.release());
285 const base::Value* actual_accounts = 286 const base::Value* actual_accounts =
286 provider_->Get(kAccountsPrefDeviceLocalAccounts); 287 provider_->Get(kAccountsPrefDeviceLocalAccounts);
287 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts)); 288 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts));
288 } 289 }
289 290
290 } // namespace chromeos 291 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_provider.cc ('k') | chrome/browser/policy/browser_policy_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698