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

Unified Diff: content/browser/plugin_loader_posix_unittest.cc

Issue 9349002: Merge 120098 - PluginLoaderPosix: Fix the case where the utility process crashes after all plugin... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 10 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') | 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
===================================================================
--- content/browser/plugin_loader_posix_unittest.cc (revision 120641)
+++ content/browser/plugin_loader_posix_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -170,6 +170,49 @@
EXPECT_EQ(1, did_callback);
}
+TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoadsThenCrash) {
+ int did_callback = 0;
+ content::PluginService::GetPluginsCallback callback =
+ base::Bind(&VerifyCallback, base::Unretained(&did_callback));
+
+ plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback);
+
+ EXPECT_CALL(*plugin_loader(), LoadPluginsInternal()).Times(2);
+ message_loop()->RunAllPending();
+
+ AddThreePlugins();
+
+ EXPECT_EQ(0u, plugin_loader()->next_load_index());
+
+ const std::vector<webkit::WebPluginInfo>& plugins(
+ plugin_loader()->loaded_plugins());
+
+ plugin_loader()->TestOnPluginLoaded(0, plugin1_);
+ EXPECT_EQ(1u, plugin_loader()->next_load_index());
+ EXPECT_EQ(1u, plugins.size());
+ EXPECT_EQ(plugin1_.name, plugins[0].name);
+
+ message_loop()->RunAllPending();
+ EXPECT_EQ(0, did_callback);
+
+ plugin_loader()->TestOnPluginLoaded(1, plugin2_);
+ EXPECT_EQ(2u, plugin_loader()->next_load_index());
+ EXPECT_EQ(2u, plugins.size());
+ EXPECT_EQ(plugin2_.name, plugins[1].name);
+
+ message_loop()->RunAllPending();
+ EXPECT_EQ(0, did_callback);
+
+ plugin_loader()->TestOnPluginLoaded(2, plugin3_);
+ EXPECT_EQ(3u, plugins.size());
+ EXPECT_EQ(plugin3_.name, plugins[2].name);
+
+ message_loop()->RunAllPending();
+ EXPECT_EQ(1, did_callback);
+
+ plugin_loader()->OnProcessCrashed(42);
+}
+
TEST_F(PluginLoaderPosixTest, TwoFailures) {
int did_callback = 0;
content::PluginService::GetPluginsCallback callback =
« 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