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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 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) 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/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 void SetUpInProcessBrowserTestFixture() override { 203 void SetUpInProcessBrowserTestFixture() override {
204 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 204 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
205 ASSERT_NO_FATAL_FAILURE(SetServerPolicy(GetEmptyPolicy())); 205 ASSERT_NO_FATAL_FAILURE(SetServerPolicy(GetEmptyPolicy()));
206 206
207 test_server_.reset(new LocalPolicyTestServer(policy_file_path())); 207 test_server_.reset(new LocalPolicyTestServer(policy_file_path()));
208 ASSERT_TRUE(test_server_->Start()); 208 ASSERT_TRUE(test_server_->Start());
209 209
210 std::string url = test_server_->GetServiceURL().spec(); 210 std::string url = test_server_->GetServiceURL().spec();
211 211
212 CommandLine* command_line = CommandLine::ForCurrentProcess(); 212 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
213 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url); 213 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url);
214 214
215 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> 215 invalidation::ProfileInvalidationProviderFactory::GetInstance()->
216 RegisterTestingFactory(BuildFakeProfileInvalidationProvider); 216 RegisterTestingFactory(BuildFakeProfileInvalidationProvider);
217 } 217 }
218 218
219 void SetUpOnMainThread() override { 219 void SetUpOnMainThread() override {
220 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service())) 220 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service()))
221 << "Pre-existing policies in this machine will make this test fail."; 221 << "Pre-existing policies in this machine will make this test fail.";
222 222
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 // They should now serialize to the same bytes. 483 // They should now serialize to the same bytes.
484 std::string chrome_settings_serialized; 484 std::string chrome_settings_serialized;
485 std::string cloud_policy_serialized; 485 std::string cloud_policy_serialized;
486 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); 486 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized));
487 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); 487 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized));
488 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); 488 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized);
489 } 489 }
490 490
491 } // namespace policy 491 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698