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

Unified Diff: content/browser/plugin_loader_posix_unittest.cc

Issue 718523002: Fix a bug that would cause the plugin_loader to stall. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from avi. Created 6 years, 1 month 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') | no next file » | 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 59e30b1ddd3d863fc92cd0546e75f9aa2e77566a..9b7e29b82484dcf9d6fe5174dd4e65df275e74c1 100644
--- a/content/browser/plugin_loader_posix_unittest.cc
+++ b/content/browser/plugin_loader_posix_unittest.cc
@@ -47,6 +47,13 @@ class MockPluginLoaderPosix : public PluginLoaderPosix {
PluginLoaderPosix::LoadPluginsInternal();
}
+ bool LaunchUtilityProcess() override {
+ // This method always does nothing and returns false. The actual
+ // implementation of this method launches another process, which is not
+ // very unit_test friendly.
+ return false;
+ }
+
void TestOnPluginLoaded(uint32 index, const WebPluginInfo& plugin) {
OnPluginLoaded(index, plugin);
}
@@ -394,4 +401,23 @@ TEST_F(PluginLoaderPosixTest, AllCrashed) {
EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size());
}
+TEST_F(PluginLoaderPosixTest, PluginLaunchFailed) {
+ int did_callback = 0;
+ PluginService::GetPluginsCallback callback =
+ base::Bind(&VerifyCallback, base::Unretained(&did_callback));
+
+ EXPECT_CALL(*plugin_loader(), LoadPluginsInternal())
+ .WillOnce(testing::Invoke(
+ plugin_loader(), &MockPluginLoaderPosix::RealLoadPluginsInternal));
+
+ plugin_loader()->GetPlugins(callback);
+ message_loop()->RunUntilIdle();
+ EXPECT_EQ(1, did_callback);
+ EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size());
+
+ // TODO(erikchen): This is a genuine leak that should be fixed.
+ // https://code.google.com/p/chromium/issues/detail?id=431906
+ testing::Mock::AllowLeak(plugin_loader());
+}
+
} // namespace content
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698