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

Unified Diff: content/browser/plugin_loader_posix_unittest.cc

Issue 8372015: [Linux] Load plugins out-of-process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/plugin_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_loader_posix_unittest.cc
diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc
index eb18428531b8462c48639912da8d56ab4194ffe2..3e268cada4dc4daed1206495b340c5bb8bc8c1db 100644
--- a/content/browser/plugin_loader_posix_unittest.cc
+++ b/content/browser/plugin_loader_posix_unittest.cc
@@ -38,6 +38,10 @@ class MockPluginLoaderPosix : public PluginLoaderPosix {
return &internal_plugins_;
}
+ void RealLoadPluginsInternal() {
+ PluginLoaderPosix::LoadPluginsInternal();
+ }
+
void TestOnPluginLoaded(const webkit::WebPluginInfo& plugin) {
OnPluginLoaded(plugin);
}
@@ -276,3 +280,36 @@ TEST_F(PluginLoaderPosixTest, InternalPlugin) {
message_loop()->RunAllPending();
EXPECT_EQ(1, did_callback);
}
+
+TEST_F(PluginLoaderPosixTest, AllCrashed) {
+ int did_callback = 0;
+ PluginService::GetPluginsCallback callback =
+ base::Bind(&VerifyCallback, base::Unretained(&did_callback));
+
+ plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback);
+
+ // Spin the loop so that the canonical list of plugins can be set.
+ EXPECT_CALL(*plugin_loader(), LoadPluginsInternal()).Times(1);
+ message_loop()->RunAllPending();
+ AddThreePlugins();
+
+ EXPECT_EQ(0u, plugin_loader()->next_load_index());
+
+ // Mock the first two calls like normal.
+ testing::Expectation first =
+ EXPECT_CALL(*plugin_loader(), LoadPluginsInternal()).Times(2);
+ // On the last call, go through the default impl.
+ EXPECT_CALL(*plugin_loader(), LoadPluginsInternal())
+ .After(first)
+ .WillOnce(
+ testing::Invoke(plugin_loader(),
+ &MockPluginLoaderPosix::RealLoadPluginsInternal));
+ plugin_loader()->OnProcessCrashed(42);
+ plugin_loader()->OnProcessCrashed(42);
+ plugin_loader()->OnProcessCrashed(42);
+
+ message_loop()->RunAllPending();
+ EXPECT_EQ(1, did_callback);
+
+ EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size());
+}
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/plugin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698