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

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

Issue 250383004: Enable fetching cloud policy for extensions by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
« no previous file with comments | « no previous file | components/policy/core/common/cloud/cloud_policy_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 119 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
120 test_server_.RegisterClient(kDMToken, kDeviceID); 120 test_server_.RegisterClient(kDMToken, kDeviceID);
121 EXPECT_TRUE(test_server_.UpdatePolicyData( 121 EXPECT_TRUE(test_server_.UpdatePolicyData(
122 dm_protocol::kChromeExtensionPolicyType, kTestExtension, kTestPolicy)); 122 dm_protocol::kChromeExtensionPolicyType, kTestExtension, kTestPolicy));
123 ASSERT_TRUE(test_server_.Start()); 123 ASSERT_TRUE(test_server_.Start());
124 124
125 std::string url = test_server_.GetServiceURL().spec(); 125 std::string url = test_server_.GetServiceURL().spec();
126 CommandLine* command_line = CommandLine::ForCurrentProcess(); 126 CommandLine* command_line = CommandLine::ForCurrentProcess();
127 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url); 127 command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, url);
128 command_line->AppendSwitch(switches::kEnableComponentCloudPolicy);
129 128
130 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); 129 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture();
131 } 130 }
132 131
133 virtual void SetUpOnMainThread() OVERRIDE { 132 virtual void SetUpOnMainThread() OVERRIDE {
134 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service())) 133 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service()))
135 << "Pre-existing policies in this machine will make this test fail."; 134 << "Pre-existing policies in this machine will make this test fail.";
136 135
137 // Install the initial extension. 136 // Install the initial extension.
138 ExtensionTestMessageListener ready_listener("ready", true); 137 ExtensionTestMessageListener ready_listener("ready", true);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true); 333 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true);
335 event_listener2.Reply("get-policy-Name"); 334 event_listener2.Reply("get-policy-Name");
336 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied()); 335 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied());
337 336
338 // And the cache is back. 337 // And the cache is back.
339 EXPECT_TRUE(base::PathExists(cache_path)); 338 EXPECT_TRUE(base::PathExists(cache_path));
340 } 339 }
341 #endif 340 #endif
342 341
343 } // namespace policy 342 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | components/policy/core/common/cloud/cloud_policy_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698