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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 | 179 |
180 TEST_F(PluginPrefsTest, UnifiedPepperFlashState) { | 180 TEST_F(PluginPrefsTest, UnifiedPepperFlashState) { |
181 base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. | 181 base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. |
182 | 182 |
183 base::MessageLoop message_loop; | 183 base::MessageLoop message_loop; |
184 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); | 184 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); |
185 webkit::npapi::MockPluginList plugin_list; | 185 webkit::npapi::MockPluginList plugin_list; |
186 PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); | 186 PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); |
187 PluginService::GetInstance()->Init(); | 187 PluginService::GetInstance()->Init(); |
188 plugin_prefs_->SetPluginListForTesting(&plugin_list); | |
189 | 188 |
190 string16 component_updated_plugin_name( | 189 string16 component_updated_plugin_name( |
191 ASCIIToUTF16("Component-updated Pepper Flash")); | 190 ASCIIToUTF16("Component-updated Pepper Flash")); |
192 webkit::WebPluginInfo component_updated_plugin_1( | 191 webkit::WebPluginInfo component_updated_plugin_1( |
193 component_updated_plugin_name, | 192 component_updated_plugin_name, |
194 GetComponentUpdatedPepperFlashPath(FILE_PATH_LITERAL("11.3.31.227")), | 193 GetComponentUpdatedPepperFlashPath(FILE_PATH_LITERAL("11.3.31.227")), |
195 ASCIIToUTF16("11.3.31.227"), | 194 ASCIIToUTF16("11.3.31.227"), |
196 ASCIIToUTF16("")); | 195 ASCIIToUTF16("")); |
197 webkit::WebPluginInfo component_updated_plugin_2( | 196 webkit::WebPluginInfo component_updated_plugin_2( |
198 component_updated_plugin_name, | 197 component_updated_plugin_name, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 EnablePluginSynchronously(true, component_updated_plugin_1.path, false); | 243 EnablePluginSynchronously(true, component_updated_plugin_1.path, false); |
245 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); | 244 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); |
246 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); | 245 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); |
247 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); | 246 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); |
248 | 247 |
249 EnablePluginSynchronously(true, bundled_plugin.path, true); | 248 EnablePluginSynchronously(true, bundled_plugin.path, true); |
250 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); | 249 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); |
251 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); | 250 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); |
252 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); | 251 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); |
253 | 252 |
254 plugin_prefs_->SetPluginListForTesting(NULL); | |
255 PluginService::GetInstance()->SetPluginListForTesting(NULL); | 253 PluginService::GetInstance()->SetPluginListForTesting(NULL); |
256 } | 254 } |
OLD | NEW |