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

Unified Diff: chrome/browser/plugins/plugin_prefs_unittest.cc

Issue 19706002: Remove plugin_list.h includes from chrome tests in preparation for moving webkit/plugins to content… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugins/plugin_prefs_unittest.cc
===================================================================
--- chrome/browser/plugins/plugin_prefs_unittest.cc (revision 212185)
+++ chrome/browser/plugins/plugin_prefs_unittest.cc (working copy)
@@ -14,8 +14,8 @@
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/plugins/npapi/mock_plugin_list.h"
#include "webkit/plugins/webplugininfo.h"
using content::BrowserThread;
@@ -46,6 +46,11 @@
return path;
}
+void GotPlugins(const base::Closure& quit_closure,
+ const std::vector<webkit::WebPluginInfo>& plugins) {
+ quit_closure.Run();
+}
+
} // namespace
class PluginPrefsTest : public ::testing::Test {
@@ -182,9 +187,8 @@
base::MessageLoop message_loop;
content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
- webkit::npapi::MockPluginList plugin_list;
- PluginService::GetInstance()->SetPluginListForTesting(&plugin_list);
PluginService::GetInstance()->Init();
+ PluginService::GetInstance()->DisablePluginsDiscoveryForTesting();
string16 component_updated_plugin_name(
ASCIIToUTF16("Component-updated Pepper Flash"));
@@ -203,10 +207,18 @@
ASCIIToUTF16("11.3.31.229"),
ASCIIToUTF16(""));
- plugin_list.AddPluginToLoad(component_updated_plugin_1);
- plugin_list.AddPluginToLoad(component_updated_plugin_2);
- plugin_list.AddPluginToLoad(bundled_plugin);
+ PluginService::GetInstance()->RegisterInternalPlugin(
+ component_updated_plugin_1, false);
+ PluginService::GetInstance()->RegisterInternalPlugin(
+ component_updated_plugin_2, false);
+ PluginService::GetInstance()->RegisterInternalPlugin(bundled_plugin, false);
+ scoped_refptr<content::MessageLoopRunner> runner =
scottmg 2013/07/18 00:33:09 was this previously a bug?
jam 2013/07/18 00:36:35 When MockPlugin was used, plugins were available i
+ new content::MessageLoopRunner;
+ PluginService::GetInstance()->GetPlugins(
+ base::Bind(&GotPlugins, runner->QuitClosure()));
+ runner->Run();
+
// Set the state of any of the three plugins will affect the others.
EnablePluginSynchronously(true, component_updated_plugin_1.path, true);
EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1));
@@ -249,6 +261,4 @@
EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1));
EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2));
EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin));
-
- PluginService::GetInstance()->SetPluginListForTesting(NULL);
}
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/printing/print_preview_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698