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

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

Issue 86913002: Make base::Base64Encode() return void (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more chromeos-specific fix. Created 7 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <string> 5 #include <string>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 "{" 80 "{"
81 " \"Another\": {" 81 " \"Another\": {"
82 " \"Value\": \"turn_it_off\"" 82 " \"Value\": \"turn_it_off\""
83 " }" 83 " }"
84 "}"; 84 "}";
85 85
86 const char kTestPolicy2JSON[] = "{\"Another\":\"turn_it_off\"}"; 86 const char kTestPolicy2JSON[] = "{\"Another\":\"turn_it_off\"}";
87 87
88 // Same encoding as ResourceCache does for its keys. 88 // Same encoding as ResourceCache does for its keys.
89 bool Base64Encode(const std::string& value, std::string* encoded) { 89 bool Base64Encode(const std::string& value, std::string* encoded) {
90 if (value.empty() || !base::Base64Encode(value, encoded)) 90 if (value.empty())
91 return false; 91 return false;
92 base::Base64Encode(value, encoded);
92 base::ReplaceChars(*encoded, "+", "-", encoded); 93 base::ReplaceChars(*encoded, "+", "-", encoded);
93 base::ReplaceChars(*encoded, "/", "_", encoded); 94 base::ReplaceChars(*encoded, "/", "_", encoded);
94 return true; 95 return true;
95 } 96 }
96 97
97 class ComponentCloudPolicyTest : public ExtensionBrowserTest { 98 class ComponentCloudPolicyTest : public ExtensionBrowserTest {
98 protected: 99 protected:
99 ComponentCloudPolicyTest() {} 100 ComponentCloudPolicyTest() {}
100 virtual ~ComponentCloudPolicyTest() {} 101 virtual ~ComponentCloudPolicyTest() {}
101 102
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true); 329 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true);
329 event_listener2.Reply("get-policy-Name"); 330 event_listener2.Reply("get-policy-Name");
330 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied()); 331 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied());
331 332
332 // And the cache is back. 333 // And the cache is back.
333 EXPECT_TRUE(base::PathExists(cache_path)); 334 EXPECT_TRUE(base::PathExists(cache_path));
334 } 335 }
335 #endif 336 #endif
336 337
337 } // namespace policy 338 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/metrics/variations/variations_service_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698