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

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

Issue 189913016: Turn on policy key verification by default (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 "base/callback.h" 5 #include "base/callback.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/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 152 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
153 ASSERT_NO_FATAL_FAILURE(SetServerPolicy(GetEmptyPolicy())); 153 ASSERT_NO_FATAL_FAILURE(SetServerPolicy(GetEmptyPolicy()));
154 154
155 test_server_.reset(new LocalPolicyTestServer(policy_file_path())); 155 test_server_.reset(new LocalPolicyTestServer(policy_file_path()));
156 ASSERT_TRUE(test_server_->Start()); 156 ASSERT_TRUE(test_server_->Start());
157 157
158 std::string url = test_server_->GetServiceURL().spec(); 158 std::string url = test_server_->GetServiceURL().spec();
159 159
160 CommandLine* command_line = CommandLine::ForCurrentProcess(); 160 CommandLine* command_line = CommandLine::ForCurrentProcess();
161 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url); 161 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url);
162 command_line->AppendSwitch(switches::kEnablePolicyKeyVerification);
163 162
164 invalidation::InvalidationServiceFactory::GetInstance()-> 163 invalidation::InvalidationServiceFactory::GetInstance()->
165 SetBuildOnlyFakeInvalidatorsForTest(true); 164 SetBuildOnlyFakeInvalidatorsForTest(true);
166 } 165 }
167 166
168 virtual void SetUpOnMainThread() OVERRIDE { 167 virtual void SetUpOnMainThread() OVERRIDE {
169 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service())) 168 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service()))
170 << "Pre-existing policies in this machine will make this test fail."; 169 << "Pre-existing policies in this machine will make this test fail.";
171 170
172 BrowserPolicyConnector* connector = 171 BrowserPolicyConnector* connector =
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 424
426 // They should now serialize to the same bytes. 425 // They should now serialize to the same bytes.
427 std::string chrome_settings_serialized; 426 std::string chrome_settings_serialized;
428 std::string cloud_policy_serialized; 427 std::string cloud_policy_serialized;
429 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); 428 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized));
430 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); 429 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized));
431 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); 430 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized);
432 } 431 }
433 432
434 } // namespace policy 433 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698