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

Unified Diff: content/renderer/browser_plugin/browser_plugin_browsertest.cc

Issue 10832207: Browser Plugin: Report Guest crash to Javascript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 8 years, 4 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/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin_browsertest.cc
diff --git a/content/renderer/browser_plugin/browser_plugin_browsertest.cc b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
index c53e9f1f827ec6f9efb45c84d160638dbf73fdd6..0e1fa0e464bf06198b326504f65d1fdcb0d13946 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -240,8 +240,22 @@ TEST_F(BrowserPluginTest, GuestCrash) {
BrowserPluginHostMsg_HandleInputEvent::ID));
browser_plugin_manager()->sink().ClearMessages();
+ const char* kAddEventListener =
+ "var msg;"
+ "function crashListener() {"
+ " msg = 'crashed';"
+ "}"
+ "document.getElementById('browserplugin')."
+ " addEventListener('crash', crashListener);";
+
+ ExecuteJavaScript(kAddEventListener);
+
// Pretend that the guest has crashed
browser_plugin->GuestCrashed();
+
+ // Verify that our event listener has fired.
+ EXPECT_EQ("crashed", ExecuteScriptAndReturnString("msg"));
+
// Send an event and verify that events are no longer deported.
browser_plugin->handleInputEvent(WebKit::WebMouseEvent(),
cursor_info);
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698