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

Unified Diff: webkit/glue/plugins/test/plugin_windowless_test.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/glue/plugins/test/plugin_windowless_test.cc
===================================================================
--- webkit/glue/plugins/test/plugin_windowless_test.cc (revision 13823)
+++ webkit/glue/plugins/test/plugin_windowless_test.cc (working copy)
@@ -29,8 +29,7 @@
NPEvent* np_event = reinterpret_cast<NPEvent*>(event);
if (WM_PAINT == np_event->event &&
- base::strcasecmp(test_name_.c_str(),
- "execute_script_delete_in_paint") == 0) {
+ test_name_ == "execute_script_delete_in_paint") {
HDC paint_dc = reinterpret_cast<HDC>(np_event->wParam);
if (paint_dc == NULL) {
SetError("Invalid Window DC passed to HandleEvent for WM_PAINT");
@@ -53,13 +52,11 @@
browser->geturl(id(), urlString, targetString);
SignalTestCompleted();
} else if (WM_MOUSEMOVE == np_event->event &&
- base::strcasecmp(test_name_.c_str(),
- "execute_script_delete_in_mouse_move") == 0) {
+ test_name_ == "execute_script_delete_in_mouse_move") {
std::string script = "javascript:DeletePluginWithinScript()";
NPString script_string;
script_string.UTF8Characters = script.c_str();
- script_string.UTF8Length =
- static_cast<unsigned int>(script.length());
+ script_string.UTF8Length = static_cast<unsigned int>(script.length());
NPObject *window_obj = NULL;
browser->getvalue(id(), NPNVWindowNPObject, &window_obj);
@@ -67,6 +64,19 @@
NPError result = browser->evaluate(id(), window_obj,
&script_string, &result_var);
SignalTestCompleted();
+ } else if (WM_LBUTTONUP == np_event->event &&
+ test_name_ == "delete_frame_test") {
+ std::string script =
+ "javascript:parent.document.getElementById('frame').outerHTML = ''";
+ NPString script_string;
+ script_string.UTF8Characters = script.c_str();
+ script_string.UTF8Length = static_cast<unsigned int>(script.length());
+
+ NPObject *window_obj = NULL;
+ browser->getvalue(id(), NPNVWindowNPObject, &window_obj);
+ NPVariant result_var;
+ NPError result = browser->evaluate(id(), window_obj,
ananta 2009/04/16 16:37:24 For consistency should we call SignalTestCompleted
jam 2009/04/16 17:56:13 I think it would confuse things since this isn't r
+ &script_string, &result_var);
}
// If this test failed, then we'd have crashed by now.
return PluginTest::HandleEvent(event);

Powered by Google App Engine
This is Rietveld 408576698