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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "chrome/browser/policy/configuration_policy_handler.h" | 9 #include "chrome/browser/policy/configuration_policy_handler.h" |
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 EXPECT_EQ(PrefStore::READ_OK, | 587 EXPECT_EQ(PrefStore::READ_OK, |
588 store_->GetValue(prefs::kDefaultSearchProviderIconURL, &value)); | 588 store_->GetValue(prefs::kDefaultSearchProviderIconURL, &value)); |
589 EXPECT_TRUE(base::StringValue(std::string()).Equals(value)); | 589 EXPECT_TRUE(base::StringValue(std::string()).Equals(value)); |
590 | 590 |
591 EXPECT_EQ(PrefStore::READ_OK, | 591 EXPECT_EQ(PrefStore::READ_OK, |
592 store_->GetValue(prefs::kDefaultSearchProviderEncodings, &value)); | 592 store_->GetValue(prefs::kDefaultSearchProviderEncodings, &value)); |
593 EXPECT_TRUE(base::StringValue(std::string()).Equals(value)); | 593 EXPECT_TRUE(base::StringValue(std::string()).Equals(value)); |
594 | 594 |
595 EXPECT_EQ(PrefStore::READ_OK, | 595 EXPECT_EQ(PrefStore::READ_OK, |
596 store_->GetValue(prefs::kDefaultSearchProviderInstantURL, &value)); | 596 store_->GetValue(prefs::kDefaultSearchProviderInstantURL, &value)); |
| 597 |
| 598 EXPECT_EQ(PrefStore::READ_OK, |
| 599 store_->GetValue(prefs::kDefaultSearchProviderAlternateURLs, |
| 600 &value)); |
| 601 |
597 EXPECT_TRUE(base::StringValue(std::string()).Equals(value)); | 602 EXPECT_TRUE(base::StringValue(std::string()).Equals(value)); |
598 } | 603 } |
599 | 604 |
600 // Checks that for a fully defined search policy, all elements have been | 605 // Checks that for a fully defined search policy, all elements have been |
601 // read properly. | 606 // read properly. |
602 TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) { | 607 TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) { |
603 PolicyMap policy; | 608 PolicyMap policy; |
604 const char* const search_url = "http://test.com/search?t={searchTerms}"; | 609 const char* const search_url = "http://test.com/search?t={searchTerms}"; |
605 const char* const suggest_url = "http://test.com/sugg?={searchTerms}"; | 610 const char* const suggest_url = "http://test.com/sugg?={searchTerms}"; |
606 const char* const icon_url = "http://test.com/icon.jpg"; | 611 const char* const icon_url = "http://test.com/icon.jpg"; |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, | 1076 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, |
1072 POLICY_SCOPE_USER, | 1077 POLICY_SCOPE_USER, |
1073 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); | 1078 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); |
1074 provider_.UpdateChromePolicy(policy); | 1079 provider_.UpdateChromePolicy(policy); |
1075 EXPECT_EQ(PrefStore::READ_OK, | 1080 EXPECT_EQ(PrefStore::READ_OK, |
1076 store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, &value)); | 1081 store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, &value)); |
1077 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); | 1082 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); |
1078 } | 1083 } |
1079 | 1084 |
1080 } // namespace policy | 1085 } // namespace policy |
OLD | NEW |