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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 ReloadDeviceSettings(); 240 ReloadDeviceSettings();
241 Mock::VerifyAndClearExpectations(this); 241 Mock::VerifyAndClearExpectations(this);
242 } 242 }
243 243
244 TEST_F(DeviceSettingsProviderTest, StatsReportingMigration) { 244 TEST_F(DeviceSettingsProviderTest, StatsReportingMigration) {
245 // Create the legacy consent file. 245 // Create the legacy consent file.
246 base::FilePath consent_file; 246 base::FilePath consent_file;
247 ASSERT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &consent_file)); 247 ASSERT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &consent_file));
248 consent_file = consent_file.AppendASCII("Consent To Send Stats"); 248 consent_file = consent_file.AppendASCII("Consent To Send Stats");
249 ASSERT_EQ(1, file_util::WriteFile(consent_file, "0", 1)); 249 ASSERT_EQ(1, base::WriteFile(consent_file, "0", 1));
250 250
251 // This should trigger migration because the metrics policy isn't in the blob. 251 // This should trigger migration because the metrics policy isn't in the blob.
252 device_settings_test_helper_.set_policy_blob(std::string()); 252 device_settings_test_helper_.set_policy_blob(std::string());
253 FlushDeviceSettings(); 253 FlushDeviceSettings();
254 EXPECT_EQ(std::string(), device_settings_test_helper_.policy_blob()); 254 EXPECT_EQ(std::string(), device_settings_test_helper_.policy_blob());
255 255
256 // Verify that migration has kicked in. 256 // Verify that migration has kicked in.
257 const base::Value* saved_value = provider_->Get(kStatsReportingPref); 257 const base::Value* saved_value = provider_->Get(kStatsReportingPref);
258 ASSERT_TRUE(saved_value); 258 ASSERT_TRUE(saved_value);
259 bool bool_value; 259 bool bool_value;
(...skipping 19 matching lines...) Expand all
279 policy::PolicyBuilder::kFakeUsername); 279 policy::PolicyBuilder::kFakeUsername);
280 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType, 280 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType,
281 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); 281 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION);
282 expected_accounts.Append(entry_dict.release()); 282 expected_accounts.Append(entry_dict.release());
283 const base::Value* actual_accounts = 283 const base::Value* actual_accounts =
284 provider_->Get(kAccountsPrefDeviceLocalAccounts); 284 provider_->Get(kAccountsPrefDeviceLocalAccounts);
285 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts)); 285 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts));
286 } 286 }
287 287
288 } // namespace chromeos 288 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/user_policy_disk_cache.cc ('k') | chrome/browser/chromeos/settings/owner_key_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698