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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_browsertest.cc

Issue 2317123002: c/browser, c/common, components O-P: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 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
« no previous file with comments | « chrome/browser/platform_util_unittest.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 5 #include <memory>
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 GetForProfile(browser()->profile()))->GetInvalidationService()); 307 GetForProfile(browser()->profile()))->GetInvalidationService());
308 } 308 }
309 309
310 void SetServerPolicy(const std::string& policy) { 310 void SetServerPolicy(const std::string& policy) {
311 int result = base::WriteFile(policy_file_path(), policy.data(), 311 int result = base::WriteFile(policy_file_path(), policy.data(),
312 policy.size()); 312 policy.size());
313 ASSERT_EQ(static_cast<int>(policy.size()), result); 313 ASSERT_EQ(static_cast<int>(policy.size()), result);
314 } 314 }
315 315
316 base::FilePath policy_file_path() const { 316 base::FilePath policy_file_path() const {
317 return temp_dir_.path().AppendASCII("policy.json"); 317 return temp_dir_.GetPath().AppendASCII("policy.json");
318 } 318 }
319 319
320 void OnPolicyUpdated(const PolicyNamespace& ns, 320 void OnPolicyUpdated(const PolicyNamespace& ns,
321 const PolicyMap& previous, 321 const PolicyMap& previous,
322 const PolicyMap& current) override { 322 const PolicyMap& current) override {
323 if (!on_policy_updated_.is_null()) { 323 if (!on_policy_updated_.is_null()) {
324 on_policy_updated_.Run(); 324 on_policy_updated_.Run();
325 on_policy_updated_.Reset(); 325 on_policy_updated_.Reset();
326 } 326 }
327 } 327 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 494
495 // They should now serialize to the same bytes. 495 // They should now serialize to the same bytes.
496 std::string chrome_settings_serialized; 496 std::string chrome_settings_serialized;
497 std::string cloud_policy_serialized; 497 std::string cloud_policy_serialized;
498 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); 498 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized));
499 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); 499 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized));
500 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); 500 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized);
501 } 501 }
502 502
503 } // namespace policy 503 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/platform_util_unittest.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698