OLD | NEW |
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 "base/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "chrome/browser/chromeos/policy/device_policy_builder.h" | 6 #include "chrome/browser/chromeos/policy/device_policy_builder.h" |
7 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 7 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
8 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 8 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
9 #include "chrome/browser/metrics/variations/variations_service.h" | 9 #include "chrome/browser/metrics/variations/variations_service.h" |
10 #include "chrome/test/base/testing_browser_process.h" | 10 #include "chrome/test/base/testing_browser_process.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 private: | 35 private: |
36 DISALLOW_COPY_AND_ASSIGN(VariationsServiceDevicePolicyTest); | 36 DISALLOW_COPY_AND_ASSIGN(VariationsServiceDevicePolicyTest); |
37 }; | 37 }; |
38 | 38 |
39 IN_PROC_BROWSER_TEST_F(VariationsServiceDevicePolicyTest, VariationsURLValid) { | 39 IN_PROC_BROWSER_TEST_F(VariationsServiceDevicePolicyTest, VariationsURLValid) { |
40 const std::string default_variations_url = | 40 const std::string default_variations_url = |
41 chrome_variations::VariationsService:: | 41 chrome_variations::VariationsService:: |
42 GetDefaultVariationsServerURLForTesting(); | 42 GetDefaultVariationsServerURLForTesting(); |
43 | 43 |
44 // Device policy has updated the cros settings. | 44 // Device policy has updated the cros settings. |
45 const GURL url = | 45 const GURL url = chrome_variations::VariationsService::GetVariationsServerURL( |
46 chrome_variations::VariationsService::GetVariationsServerURL( | 46 g_browser_process->local_state(), std::string()); |
47 g_browser_process->local_state()); | |
48 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 47 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
49 std::string value; | 48 std::string value; |
50 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 49 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
51 EXPECT_EQ("restricted", value); | 50 EXPECT_EQ("restricted", value); |
52 } | 51 } |
53 | 52 |
54 } // namespace policy | 53 } // namespace policy |
OLD | NEW |