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

Side by Side Diff: chrome/browser/policy/configuration_policy_pref_store_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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
OLDNEW
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/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/prefs/pref_store_observer_mock.h" 10 #include "base/prefs/pref_store_observer_mock.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 void UpdateProviderPolicy(const PolicyMap& policy) { 63 void UpdateProviderPolicy(const PolicyMap& policy) {
64 provider_.UpdateChromePolicy(policy); 64 provider_.UpdateChromePolicy(policy);
65 base::RunLoop loop; 65 base::RunLoop loop;
66 loop.RunUntilIdle(); 66 loop.RunUntilIdle();
67 } 67 }
68 68
69 MockConfigurationPolicyProvider provider_; 69 MockConfigurationPolicyProvider provider_;
70 scoped_ptr<PolicyServiceImpl> policy_service_; 70 scoped_ptr<PolicyServiceImpl> policy_service_;
71 scoped_refptr<ConfigurationPolicyPrefStore> store_; 71 scoped_refptr<ConfigurationPolicyPrefStore> store_;
72 MessageLoop loop_; 72 base::MessageLoop loop_;
73 }; 73 };
74 74
75 // Test cases for list-valued policy settings. 75 // Test cases for list-valued policy settings.
76 class ConfigurationPolicyPrefStoreListTest 76 class ConfigurationPolicyPrefStoreListTest
77 : public ConfigurationPolicyPrefStoreTest, 77 : public ConfigurationPolicyPrefStoreTest,
78 public testing::WithParamInterface<PolicyAndPref> {}; 78 public testing::WithParamInterface<PolicyAndPref> {};
79 79
80 TEST_P(ConfigurationPolicyPrefStoreListTest, GetDefault) { 80 TEST_P(ConfigurationPolicyPrefStoreListTest, GetDefault) {
81 EXPECT_FALSE(store_->GetValue(GetParam().pref_name(), NULL)); 81 EXPECT_FALSE(store_->GetValue(GetParam().pref_name(), NULL));
82 } 82 }
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, 1100 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY,
1101 POLICY_SCOPE_USER, 1101 POLICY_SCOPE_USER,
1102 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); 1102 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
1103 UpdateProviderPolicy(policy); 1103 UpdateProviderPolicy(policy);
1104 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, 1104 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting,
1105 &value)); 1105 &value));
1106 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); 1106 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value));
1107 } 1107 }
1108 1108
1109 } // namespace policy 1109 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698