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

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

Issue 12088022: Enable cloud policy by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 7 years, 10 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 "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 new net::TestServer( 127 new net::TestServer(
128 net::TestServer::TYPE_HTTP, 128 net::TestServer::TYPE_HTTP,
129 net::TestServer::kLocalhost, 129 net::TestServer::kLocalhost,
130 temp_dir_.path().BaseName())); 130 temp_dir_.path().BaseName()));
131 ASSERT_TRUE(test_server_->Start()); 131 ASSERT_TRUE(test_server_->Start());
132 132
133 std::string url = test_server_->GetURL("device_management").spec(); 133 std::string url = test_server_->GetURL("device_management").spec();
134 134
135 CommandLine* command_line = CommandLine::ForCurrentProcess(); 135 CommandLine* command_line = CommandLine::ForCurrentProcess();
136 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url); 136 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url);
137 command_line->AppendSwitch(switches::kLoadCloudPolicyOnSignin);
138 } 137 }
139 138
140 virtual void SetUpOnMainThread() OVERRIDE { 139 virtual void SetUpOnMainThread() OVERRIDE {
141 // Checks that no policies have been loaded by the other providers before 140 // Checks that no policies have been loaded by the other providers before
142 // setting up the cloud connection. Other policies configured in the test 141 // setting up the cloud connection. Other policies configured in the test
143 // machine will interfere with these tests. 142 // machine will interfere with these tests.
144 const PolicyMap& map = g_browser_process->policy_service()->GetPolicies( 143 const PolicyMap& map = g_browser_process->policy_service()->GetPolicies(
145 POLICY_DOMAIN_CHROME, ""); 144 POLICY_DOMAIN_CHROME, "");
146 if (!map.empty()) { 145 if (!map.empty()) {
147 base::DictionaryValue dict; 146 base::DictionaryValue dict;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 279
281 // They should now serialize to the same bytes. 280 // They should now serialize to the same bytes.
282 std::string chrome_settings_serialized; 281 std::string chrome_settings_serialized;
283 std::string cloud_policy_serialized; 282 std::string cloud_policy_serialized;
284 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); 283 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized));
285 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); 284 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized));
286 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); 285 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized);
287 } 286 }
288 287
289 } // namespace policy 288 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.cc ('k') | chrome/browser/policy/user_policy_signin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698