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

Side by Side Diff: chrome/browser/chromeos/policy/variations_service_policy_browsertest.cc

Issue 14268009: Support VariationsRestrictParameter in VariationsService for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added TODO about MockImageBurnerClient Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/policy/device_policy_builder.h"
6 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
7 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
8 #include "chrome/browser/metrics/variations/variations_service.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace policy {
12
13 class VariationsServiceDevicePolicyTest : public DevicePolicyCrosBrowserTest {
14 protected:
15 VariationsServiceDevicePolicyTest() {}
16
17 void SetUpInProcessBrowserTestFixture() OVERRIDE {
18 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture();
19
20 InstallOwnerKey();
21 SetSpecificDevicePolicies();
22 RefreshDevicePolicy();
23 }
24
25 void SetSpecificDevicePolicies() {
26 // Setup the device policy DeviceVariationsRestrictParameter.
27 enterprise_management::ChromeDeviceSettingsProto& proto(
28 device_policy()->payload());
29 proto.mutable_variations_parameter()->set_parameter("restricted");
30 }
31
32 private:
33 DISALLOW_COPY_AND_ASSIGN(VariationsServiceDevicePolicyTest);
34 };
35
36 IN_PROC_BROWSER_TEST_F(VariationsServiceDevicePolicyTest, VariationsURLValid) {
37 const std::string default_variations_url =
38 chrome_variations::VariationsService::
39 GetDefaultVariationsServerURLForTesting();
40
41 // Device policy has updated the cros settings.
42 EXPECT_EQ(default_variations_url + "?restrict=restricted",
43 chrome_variations::VariationsService::GetVariationsServerURL(
44 browser_process()->local_state()).spec());
45 }
46
47 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698