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

Unified Diff: chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc

Issue 233423002: Don't upload extension IDs in the cloud policy protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/policy/test/policy_testserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc b/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
index 71832f3a88ad9e1735b26e5ec8696eae9466c380..be943c491bd5b3bb4119e8069226249068bc7d48 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
+++ b/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
@@ -54,6 +54,8 @@ namespace em = enterprise_management;
namespace policy {
+namespace {
+
const char kDMToken[] = "dmtoken";
const char kDeviceID[] = "deviceid";
@@ -84,8 +86,9 @@ const char kTestPolicy2[] =
const char kTestPolicy2JSON[] = "{\"Another\":\"turn_it_off\"}";
+#if !defined(OS_CHROMEOS)
// Same encoding as ResourceCache does for its keys.
-bool Base64Encode(const std::string& value, std::string* encoded) {
+bool Base64UrlEncode(const std::string& value, std::string* encoded) {
if (value.empty())
return false;
base::Base64Encode(value, encoded);
@@ -93,6 +96,9 @@ bool Base64Encode(const std::string& value, std::string* encoded) {
base::ReplaceChars(*encoded, "/", "_", encoded);
return true;
}
+#endif
+
+} // namespace
class ComponentCloudPolicyTest : public ExtensionBrowserTest {
protected:
@@ -294,9 +300,9 @@ IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, SignOutAndBackIn) {
// Verify that the policy cache exists.
std::string cache_key;
- ASSERT_TRUE(Base64Encode("extension-policy", &cache_key));
+ ASSERT_TRUE(Base64UrlEncode("extension-policy", &cache_key));
std::string cache_subkey;
- ASSERT_TRUE(Base64Encode(kTestExtension, &cache_subkey));
+ ASSERT_TRUE(Base64UrlEncode(kTestExtension, &cache_subkey));
base::FilePath cache_path = browser()->profile()->GetPath()
.Append(FILE_PATH_LITERAL("Policy"))
.Append(FILE_PATH_LITERAL("Components"))
« no previous file with comments | « no previous file | chrome/browser/policy/test/policy_testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698