Chromium Code Reviews| Index: chrome/browser/policy/config_dir_policy_provider_unittest.cc |
| diff --git a/chrome/browser/policy/config_dir_policy_provider_unittest.cc b/chrome/browser/policy/config_dir_policy_provider_unittest.cc |
| index 25893da6640a5219eaa5ed00b06fc84b1a9d102c..a4adbe25ab2c8611bc62d3b31e4de399f5d2256c 100644 |
| --- a/chrome/browser/policy/config_dir_policy_provider_unittest.cc |
| +++ b/chrome/browser/policy/config_dir_policy_provider_unittest.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/path_service.h" |
| #include "base/scoped_temp_dir.h" |
| #include "base/string_number_conversions.h" |
| +#include "chrome/browser/browser_thread.h" |
| #include "chrome/browser/policy/config_dir_policy_provider.h" |
| #include "chrome/browser/policy/configuration_policy_pref_store.h" |
| #include "chrome/browser/policy/mock_configuration_policy_store.h" |
| @@ -26,6 +27,10 @@ class ConfigDirPolicyProviderTestBase : public BASE { |
| ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); |
| } |
| + virtual void TearDown() { |
| + file_util::Delete(test_dir_.path(), true); |
|
Mattias Nissler (ping if slow)
2010/12/09 09:27:17
This is not necessary, since ScopedTempDir deletes
danno
2010/12/09 10:23:02
You're looking at an old version. This code is not
|
| + } |
| + |
| // JSON-encode a dictionary and write it to a file. |
| void WriteConfigFile(const DictionaryValue& dict, |
| const std::string& file_name) { |
| @@ -49,7 +54,7 @@ class ConfigDirPolicyLoaderTest |
| // The preferences dictionary is expected to be empty when there are no files to |
| // load. |
| TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsEmpty) { |
| - ConfigDirPolicyLoader loader(test_dir()); |
| + ConfigDirPolicyProviderDelegate loader(test_dir()); |
| scoped_ptr<DictionaryValue> policy(loader.Load()); |
| EXPECT_TRUE(policy.get()); |
| EXPECT_TRUE(policy->empty()); |
| @@ -59,7 +64,7 @@ TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsEmpty) { |
| // dictionary. |
| TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsNonExistentDirectory) { |
| FilePath non_existent_dir(test_dir().Append(FILE_PATH_LITERAL("not_there"))); |
| - ConfigDirPolicyLoader loader(non_existent_dir); |
| + ConfigDirPolicyProviderDelegate loader(non_existent_dir); |
| scoped_ptr<DictionaryValue> policy(loader.Load()); |
| EXPECT_TRUE(policy.get()); |
| EXPECT_TRUE(policy->empty()); |
| @@ -71,7 +76,7 @@ TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsSinglePref) { |
| test_dict.SetString("HomepageLocation", "http://www.google.com"); |
| WriteConfigFile(test_dict, "config_file"); |
| - ConfigDirPolicyLoader loader(test_dir()); |
| + ConfigDirPolicyProviderDelegate loader(test_dir()); |
| scoped_ptr<DictionaryValue> policy(loader.Load()); |
| EXPECT_TRUE(policy.get()); |
| EXPECT_TRUE(policy->Equals(&test_dict)); |
| @@ -93,7 +98,7 @@ TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsMergePrefs) { |
| for (unsigned int i = 5; i <= 8; ++i) |
| WriteConfigFile(test_dict_bar, base::IntToString(i)); |
| - ConfigDirPolicyLoader loader(test_dir()); |
| + ConfigDirPolicyProviderDelegate loader(test_dir()); |
| scoped_ptr<DictionaryValue> policy(loader.Load()); |
| EXPECT_TRUE(policy.get()); |
| EXPECT_TRUE(policy->Equals(&test_dict_foo)); |