| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 plugin_prefs_->PolicyStatusForPlugin(kGoogleMars)); | 207 plugin_prefs_->PolicyStatusForPlugin(kGoogleMars)); |
| 208 EXPECT_EQ(PluginPrefs::POLICY_DISABLED, | 208 EXPECT_EQ(PluginPrefs::POLICY_DISABLED, |
| 209 plugin_prefs_->PolicyStatusForPlugin(k42)); | 209 plugin_prefs_->PolicyStatusForPlugin(k42)); |
| 210 } | 210 } |
| 211 | 211 |
| 212 TEST_F(PluginPrefsTest, UnifiedPepperFlashState) { | 212 TEST_F(PluginPrefsTest, UnifiedPepperFlashState) { |
| 213 base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. | 213 base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. |
| 214 | 214 |
| 215 MessageLoop message_loop; | 215 MessageLoop message_loop; |
| 216 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); | 216 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); |
| 217 webkit::npapi::MockPluginList plugin_list(NULL, 0); | 217 webkit::npapi::MockPluginList plugin_list; |
| 218 PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); | 218 PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); |
| 219 PluginService::GetInstance()->Init(); | 219 PluginService::GetInstance()->Init(); |
| 220 plugin_prefs_->SetPluginListForTesting(&plugin_list); | 220 plugin_prefs_->SetPluginListForTesting(&plugin_list); |
| 221 | 221 |
| 222 string16 component_updated_plugin_name( | 222 string16 component_updated_plugin_name( |
| 223 ASCIIToUTF16("Component-updated Pepper Flash")); | 223 ASCIIToUTF16("Component-updated Pepper Flash")); |
| 224 webkit::WebPluginInfo component_updated_plugin_1( | 224 webkit::WebPluginInfo component_updated_plugin_1( |
| 225 component_updated_plugin_name, | 225 component_updated_plugin_name, |
| 226 GetComponentUpdatedPepperFlashPath(FILE_PATH_LITERAL("11.3.31.227")), | 226 GetComponentUpdatedPepperFlashPath(FILE_PATH_LITERAL("11.3.31.227")), |
| 227 ASCIIToUTF16("11.3.31.227"), | 227 ASCIIToUTF16("11.3.31.227"), |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); | 280 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); |
| 281 | 281 |
| 282 EnablePluginSynchronously(true, bundled_plugin.path, true); | 282 EnablePluginSynchronously(true, bundled_plugin.path, true); |
| 283 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); | 283 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); |
| 284 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); | 284 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); |
| 285 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); | 285 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); |
| 286 | 286 |
| 287 plugin_prefs_->SetPluginListForTesting(NULL); | 287 plugin_prefs_->SetPluginListForTesting(NULL); |
| 288 PluginService::GetInstance()->SetPluginListForTesting(NULL); | 288 PluginService::GetInstance()->SetPluginListForTesting(NULL); |
| 289 } | 289 } |
| OLD | NEW |