| 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 "chrome/browser/plugins/plugin_prefs.h" | 5 #include "chrome/browser/plugins/plugin_prefs.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void GotPlugins(const base::Closure& quit_closure, | 52 void GotPlugins(const base::Closure& quit_closure, |
| 53 const std::vector<content::WebPluginInfo>& plugins) { | 53 const std::vector<content::WebPluginInfo>& plugins) { |
| 54 quit_closure.Run(); | 54 quit_closure.Run(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 class PluginPrefsTest : public ::testing::Test { | 59 class PluginPrefsTest : public ::testing::Test { |
| 60 public: | 60 public: |
| 61 virtual void SetUp() OVERRIDE { | 61 virtual void SetUp() override { |
| 62 plugin_prefs_ = new PluginPrefs(); | 62 plugin_prefs_ = new PluginPrefs(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void SetPolicyEnforcedPluginPatterns( | 65 void SetPolicyEnforcedPluginPatterns( |
| 66 const std::set<base::string16>& disabled, | 66 const std::set<base::string16>& disabled, |
| 67 const std::set<base::string16>& disabled_exceptions, | 67 const std::set<base::string16>& disabled_exceptions, |
| 68 const std::set<base::string16>& enabled) { | 68 const std::set<base::string16>& enabled) { |
| 69 plugin_prefs_->SetPolicyEnforcedPluginPatterns( | 69 plugin_prefs_->SetPolicyEnforcedPluginPatterns( |
| 70 disabled, disabled_exceptions, enabled); | 70 disabled, disabled_exceptions, enabled); |
| 71 } | 71 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); | 274 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); |
| 275 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); | 275 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); |
| 276 | 276 |
| 277 EnablePluginSynchronously(true, bundled_plugin.path, true); | 277 EnablePluginSynchronously(true, bundled_plugin.path, true); |
| 278 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); | 278 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); |
| 279 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); | 279 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); |
| 280 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); | 280 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); |
| 281 } | 281 } |
| 282 | 282 |
| 283 #endif | 283 #endif |
| OLD | NEW |