Changeset 20625 in webkit
- Timestamp:
- Mar 30, 2007 2:41:00 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r20617 r20625 1 2007-03-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoff. 4 5 * plugins/destroy-stream-twice.html: 6 Put the scripts before the embed element. Set the timeout in the onstreamload handler. 7 1 8 2007-03-30 Justin Garcia <justin.garcia@apple.com> 2 9 -
trunk/LayoutTests/plugins/destroy-stream-twice.html
r20597 r20625 6 6 <p id="description"></p> 7 7 <div id="console"></div> 8 <embed id="plugin" 9 type="application/x-webkit-test-netscape" 10 src="data:text/plain," 11 style="width:0; height:0"> 12 </embed> 8 <script> 9 function main() 10 { 11 if (!window.layoutTestController) { 12 debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n"); 13 return; 14 } 13 15 14 <script> 15 description("Test for http://bugs.webkit.org/show_bug.cgi?id=13203: REGRESSION: Repro crash in -[WebBaseNetscapePluginView(WebNPPCallbacks) destroyStream:reason:] navigating away from page with DivX movie plug-in"); 16 layoutTestController.waitUntilDone(); 17 } 18 main(); 16 19 17 20 function runTest() … … 29 32 layoutTestController.notifyDone(); 30 33 } 34 </script> 35 <embed id="plugin" 36 type="application/x-webkit-test-netscape" 37 src="data:text/plain," 38 style="width:0; height:0" 39 onstreamload="setTimeout(runTest, 0);"> 40 </embed> 31 41 32 function main() 33 { 34 if (!window.layoutTestController) { 35 debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n"); 36 return; 37 } 42 <script> 43 description("Test for http://bugs.webkit.org/show_bug.cgi?id=13203: REGRESSION: Repro crash in -[WebBaseNetscapePluginView(WebNPPCallbacks) destroyStream:reason:] navigating away from page with DivX movie plug-in"); 38 44 39 layoutTestController.waitUntilDone();40 setTimeout(runTest, 5); // FIXME: Don't know how to wait until a plug-in stream has loaded.41 }42 main();43 45 44 46 successfullyParsed = true; -
trunk/WebKitTools/ChangeLog
r20621 r20625 1 2007-03-30 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoff. 4 5 Add an "onstreamload" attribute to the plugin which is called when a stream starts loading. 6 7 * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: 8 * DumpRenderTree/TestNetscapePlugIn.subproj/main.c: 9 (NPP_New): 10 Look for the onstreamload attribute. 11 12 (NPP_Destroy): 13 Free the onstreamload attribute. 14 15 (NPP_NewStream): 16 Call the onstreamload handler. 17 1 18 2007-03-30 Geoffrey Garen <ggaren@apple.com> 2 19 -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
r20613 r20625 42 42 NPObject* testObject; 43 43 NPStream* stream; 44 char* onStreamLoad; 44 45 } PluginObject; 45 46 -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.c
r20597 r20625 73 73 NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved) 74 74 { 75 if (browser->version >= 14) 76 instance->pdata = browser->createobject(instance, getPluginClass()); 75 if (browser->version >= 14) { 76 PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); 77 78 obj->onStreamLoad = NULL; 79 80 for (uint i = 0; i < argc; i++) { 81 if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad) 82 obj->onStreamLoad = strdup(argv[i]); 83 } 84 85 instance->pdata = obj; 86 } 87 77 88 return NPERR_NO_ERROR; 78 89 } … … 81 92 { 82 93 PluginObject *obj = instance->pdata; 83 if (obj) 94 if (obj) { 95 if (obj->onStreamLoad) 96 free(obj->onStreamLoad); 97 84 98 browser->releaseobject(&obj->header); 99 } 85 100 return NPERR_NO_ERROR; 86 101 } … … 97 112 *stype = NP_ASFILEONLY; 98 113 114 if (obj->onStreamLoad) { 115 NPObject *windowScriptObject; 116 browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); 117 118 NPString script; 119 script.UTF8Characters = obj->onStreamLoad; 120 script.UTF8Length = strlen(obj->onStreamLoad); 121 122 NPVariant browserResult; 123 browser->evaluate(obj->npp, windowScriptObject, &script, &browserResult); 124 browser->releasevariantvalue(&browserResult); 125 } 126 99 127 return NPERR_NO_ERROR; 100 128 }
Note: See TracChangeset
for help on using the changeset viewer.