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

Unified Diff: content/browser/browser_plugin/browser_plugin_host_browsertest.cc

Issue 11094080: Browser Plugin: More robust recovery from guest crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed part of test that is no longer valid Created 8 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
Index: content/browser/browser_plugin/browser_plugin_host_browsertest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index 907a7c88a9596a4242c51569d7e086152488a01e..4a2ccfbeba01fe44076fe683ed65c0b42be1ae49 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -675,6 +675,49 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) {
test_guest()->WaitForCrashed();
}
+// This test verifies that the guest is responsive after crashing and going back
+// to a previous navigation entry.
+IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) {
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html";
+ StartBrowserPluginTest(
+ kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, "");
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
+ test_embedder()->web_contents()->GetRenderViewHost());
+
+ // Navigate to P2 and verify that the navigation occurred.
+ {
+ const string16 expected_title = ASCIIToUTF16("P2");
+ content::TitleWatcher title_watcher(test_guest()->web_contents(),
+ expected_title);
+
+ ExecuteSyncJSFunction(rvh, ASCIIToUTF16(StringPrintf("SetSrc('%s');",
+ GetHTMLForGuestWithTitle("P2").c_str())));
+
+ string16 actual_title = title_watcher.WaitAndGetTitle();
+ EXPECT_EQ(expected_title, actual_title);
+ }
+ // Kill the guest.
+ ExecuteSyncJSFunction(rvh,
+ ASCIIToUTF16("document.getElementById('plugin').terminate()"));
+
+ // Expect the guest to report that it crashed.
+ test_guest()->WaitForCrashed();
+ // Go back and verify that we're back at P1.
+ {
+ const string16 expected_title = ASCIIToUTF16("P1");
+ content::TitleWatcher title_watcher(test_guest()->web_contents(),
+ expected_title);
+
+ ExecuteSyncJSFunction(rvh, ASCIIToUTF16("Back();"));
+
+ string16 actual_title = title_watcher.WaitAndGetTitle();
+ EXPECT_EQ(expected_title, actual_title);
+ }
+ // Send an input event and verify that the guest receives the input.
+ SimulateMouseClick(test_embedder()->web_contents());
+ test_guest()->WaitForInput();
+}
+
IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) {
const char kEmbedderURL[] = "files/browser_plugin_embedder.html";
StartBrowserPluginTest(kEmbedderURL, "about:blank", true, "");
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/browser_plugin/test_browser_plugin_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698