| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 3762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3773 }; | 3773 }; |
| 3774 | 3774 |
| 3775 IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) { | 3775 IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) { |
| 3776 const std::string default_variations_url = | 3776 const std::string default_variations_url = |
| 3777 chrome_variations::VariationsService:: | 3777 chrome_variations::VariationsService:: |
| 3778 GetDefaultVariationsServerURLForTesting(); | 3778 GetDefaultVariationsServerURLForTesting(); |
| 3779 | 3779 |
| 3780 const GURL url = | 3780 const GURL url = |
| 3781 chrome_variations::VariationsService::GetVariationsServerURL( | 3781 chrome_variations::VariationsService::GetVariationsServerURL( |
| 3782 g_browser_process->local_state(), std::string()); | 3782 g_browser_process->local_state(), std::string()); |
| 3783 EXPECT_TRUE(base::StartsWithASCII(url.spec(), default_variations_url, true)); | 3783 EXPECT_TRUE(base::StartsWith(url.spec(), default_variations_url, |
| 3784 base::CompareCase::SENSITIVE)); |
| 3784 std::string value; | 3785 std::string value; |
| 3785 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 3786 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
| 3786 EXPECT_EQ("restricted", value); | 3787 EXPECT_EQ("restricted", value); |
| 3787 } | 3788 } |
| 3788 | 3789 |
| 3789 IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistSelective) { | 3790 IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistSelective) { |
| 3790 base::ListValue blacklist; | 3791 base::ListValue blacklist; |
| 3791 blacklist.Append(new base::StringValue("host.name")); | 3792 blacklist.Append(new base::StringValue("host.name")); |
| 3792 PolicyMap policies; | 3793 PolicyMap policies; |
| 3793 policies.Set(key::kNativeMessagingBlacklist, POLICY_LEVEL_MANDATORY, | 3794 policies.Set(key::kNativeMessagingBlacklist, POLICY_LEVEL_MANDATORY, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3831 PrefService* prefs = browser()->profile()->GetPrefs(); | 3832 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 3832 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( | 3833 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( |
| 3833 prefs, "host.name")); | 3834 prefs, "host.name")); |
| 3834 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( | 3835 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( |
| 3835 prefs, "other.host.name")); | 3836 prefs, "other.host.name")); |
| 3836 } | 3837 } |
| 3837 | 3838 |
| 3838 #endif // !defined(CHROME_OS) | 3839 #endif // !defined(CHROME_OS) |
| 3839 | 3840 |
| 3840 } // namespace policy | 3841 } // namespace policy |
| OLD | NEW |