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

Unified Diff: webkit/tools/test_shell/plugin_tests.cc

Issue 75026: Ensure we check the page pointer before using it after we come out of NPP_Han... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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: webkit/tools/test_shell/plugin_tests.cc
===================================================================
--- webkit/tools/test_shell/plugin_tests.cc (revision 13823)
+++ webkit/tools/test_shell/plugin_tests.cc (working copy)
@@ -7,8 +7,10 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "net/base/escape.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "webkit/glue/webframe.h"
#include "webkit/glue/webview.h"
#include "webkit/tools/test_shell/test_shell.h"
@@ -123,3 +125,22 @@
ASSERT_EQ(true, StartsWith(text, L"DONE", true));
}
+
+// Tests that if a frame is deleted as a result of calling NPP_HandleEvent, we
+// don't crash.
+TEST_F(PluginTest, DeleteFrameDuringEvent) {
+ FilePath test_html = data_dir_;
+ test_html = test_html.AppendASCII("plugins");
+ test_html = test_html.AppendASCII("delete_frame.html");
+ test_shell_->LoadURL(test_html.ToWStringHack().c_str());
+ test_shell_->WaitTestFinished();
+
+ WebKit::WebMouseEvent input;
+ input.button = WebKit::WebMouseEvent::ButtonLeft;
+ input.x = 50;
+ input.y = 50;
+ input.type = WebKit::WebInputEvent::MouseUp;
+ test_shell_->webView()->HandleInputEvent(&input);
+
+ // No crash means we passed.
+}
« webkit/glue/plugins/webplugin_delegate_impl.cc ('K') | « webkit/glue/webplugin_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698