haikuwebkit/LayoutTests/plugins/document-open.html

21 lines
433 B
HTML
Raw Permalink Normal View History

2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. Added layout tests to test document.open and window.open calls issued by NPAPI plugins without a calling javascript context. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. * plugins/document-open-expected.txt: Added. * plugins/document-open.html: Added. * plugins/window-open-expected.txt: Added. * plugins/window-open.html: Added. 2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium only. Changes to V8HTMLDocumentCustom.cpp are as below:- 1. The HTMLDocumentOpen function would cause a crash in Chromium if there was no calling javascript context. We now check for this case and pass in NULL to the HTMLDocument::open function which can handle a NULL document parameter. 2. The other functions like HTMLDocumentWrite, HTMLDocumentWriteln, etc had ASSERTS for a NULL caller frame, which was bogus as it would crash anyway. We now check for this case and return a failure. Changes to V8DOMWindowCustom.cpp are as below:- 1. Instead of failing the window.open call made by NPAPI for lack of a calling javascript context, we now use the entered context as the calling context. Tests: plugins/document-open.html plugins/window-open.html * bindings/v8/custom/V8DOMWindowCustom.cpp: (WebCore::CALLBACK_FUNC_DECL): * bindings/v8/custom/V8HTMLDocumentCustom.cpp: (WebCore::CALLBACK_FUNC_DECL): 2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. Added functionality to the layout test plugin to invoke document.open and window.open with default arguments. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. Basically window.open and document.open calls issued by NPAPI plugins via NPN_Invoke don't work in Chromium (V8) if there is no calling javascript context. To achieve this effect we invoke these functions in the layout test plugin in the NPP_SetWindow for the window.open test case and in NPP_DestroyStream for the document.open test case. * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (testDocumentOpen): (testWindowOpen): (pluginAllocate): * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: (NPP_New): (NPP_SetWindow): (NPP_DestroyStream): * DumpRenderTree/win/TestNetscapePlugin/main.cpp: (NPP_New): (NPP_SetWindow): (NPP_NewStream): (NPP_DestroyStream): Canonical link: https://commits.webkit.org/42037@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2009-11-06 23:00:44 +00:00
<html>
<head>
<body>
<embed id="testPlugin"
type="application/x-webkit-test-netscape"
src="data:text/plain,"
Refactor TestNetscapePlugin so tests can be split in separate files https://bugs.webkit.org/show_bug.cgi?id=43220 Reviewed by Sam Weinig. WebKitTools: * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Add PluginTest.cpp, PluginTest.h and Tests/DocumentOpenInDestroyStream.cpp. * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp: (pluginAllocate): Initialize pluginTest to 0. Remove testDocumentOpenInDestroyStream. * DumpRenderTree/TestNetscapePlugIn/PluginObject.h: * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp: Added. (PluginTest::PluginTest): Initialize m_npp and the test identifier. (PluginTest::createTestFunctions): Return the map from identifiers to createTest functions. (PluginTest::registerCreateTestFunction): Insert the identifier and create function pair in the map. (PluginTest::create): Look for a createTest function. If one is found, call it. Otherwise create a vanilla PluginTest object. * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added. (PluginTest::Register::Register): Helper class template for registering plug-in tests. (PluginTest::Register::create): Create a new test of the given type. * DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp: Added. (DocumentOpenInDestroyStream::DocumentOpenInDestroyStream): Add a test that calls testDocumentOpen from its NPP_DestroyStream callback. * DumpRenderTree/TestNetscapePlugIn/main.cpp: (NPP_New): Create a PluginTest given the identifier. Remove the check for "testdocumentopenindestroystream". (NPP_DestroyStream): Call the plug-in test NPP_DestroyStream member function. * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Add PluginTest.cpp, PluginTest.h and Tests/DocumentOpenInDestroyStream.cpp. LayoutTests: * plugins/document-open.html: Pass the test identifier as an attribute of the embed tag. Canonical link: https://commits.webkit.org/55146@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-30 00:11:45 +00:00
test="document-open-in-destroy-stream">
2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. Added layout tests to test document.open and window.open calls issued by NPAPI plugins without a calling javascript context. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. * plugins/document-open-expected.txt: Added. * plugins/document-open.html: Added. * plugins/window-open-expected.txt: Added. * plugins/window-open.html: Added. 2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium only. Changes to V8HTMLDocumentCustom.cpp are as below:- 1. The HTMLDocumentOpen function would cause a crash in Chromium if there was no calling javascript context. We now check for this case and pass in NULL to the HTMLDocument::open function which can handle a NULL document parameter. 2. The other functions like HTMLDocumentWrite, HTMLDocumentWriteln, etc had ASSERTS for a NULL caller frame, which was bogus as it would crash anyway. We now check for this case and return a failure. Changes to V8DOMWindowCustom.cpp are as below:- 1. Instead of failing the window.open call made by NPAPI for lack of a calling javascript context, we now use the entered context as the calling context. Tests: plugins/document-open.html plugins/window-open.html * bindings/v8/custom/V8DOMWindowCustom.cpp: (WebCore::CALLBACK_FUNC_DECL): * bindings/v8/custom/V8HTMLDocumentCustom.cpp: (WebCore::CALLBACK_FUNC_DECL): 2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. Added functionality to the layout test plugin to invoke document.open and window.open with default arguments. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. Basically window.open and document.open calls issued by NPAPI plugins via NPN_Invoke don't work in Chromium (V8) if there is no calling javascript context. To achieve this effect we invoke these functions in the layout test plugin in the NPP_SetWindow for the window.open test case and in NPP_DestroyStream for the document.open test case. * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (testDocumentOpen): (testWindowOpen): (pluginAllocate): * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: (NPP_New): (NPP_SetWindow): (NPP_DestroyStream): * DumpRenderTree/win/TestNetscapePlugin/main.cpp: (NPP_New): (NPP_SetWindow): (NPP_NewStream): (NPP_DestroyStream): Canonical link: https://commits.webkit.org/42037@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2009-11-06 23:00:44 +00:00
</embed>
<div>
This tests that document.open invoked by a plugin via NPN_Invoke without a javascript context succeeds.
</div>
<script>
Use testRunner instead of layoutTestController in networkinformation, perf, plugins, pointer-lock, printing, scrollbars, and security tests https://bugs.webkit.org/show_bug.cgi?id=89181 Reviewed by Kent Tamura. * perf/clone-with-focus.html: * perf/nested-combined-selectors.html: * perf/table-rows-length-caching.html: * platform/chromium/plugins/call-as-function.html: * platform/chromium/plugins/get-url-with-blank-target2.html: * platform/chromium/plugins/get-url-with-iframe-target-no-crash.html: * platform/chromium/printing/custom-page-size-style-expected.txt: * platform/chromium/printing/custom-page-size-style.html: * platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html: * platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html: * platform/mac-wk2/plugins/contents-scale-factor.html: * platform/mac-wk2/plugins/mouse-events-scaled.html: * platform/mac/plugins/bindings-array-apply-crash.html: * platform/mac/plugins/bindings-objc-long-method-name.html: * platform/mac/plugins/bindings-objc-method-name-conversion.html: * platform/mac/plugins/bindings-test-objc.html: * platform/mac/plugins/call-as-function-test.html: * platform/mac/plugins/convert-point.html: * platform/mac/plugins/disable-plugins.html: * platform/mac/plugins/jsobjc-dom-wrappers.html: * platform/mac/plugins/jsobjc-simple.html: * platform/mac/plugins/pluginDocumentView-deallocated-dataSource.html-disabled: * platform/mac/plugins/root-object-premature-delete-crash.html: * platform/mac/plugins/supports-carbon-event-model.html: * platform/mac/plugins/testplugin-onnew-onpaint.html: * platform/mac/plugins/throw-on-dealloc.html: * platform/mac/plugins/undefined-property-crash.html: * platform/mac/plugins/update-widget-from-style-recalc.html: * platform/mac/plugins/webScriptObject-exception-deadlock.html: * platform/mac/scrollbars/key-window-not-first-responder.html: * platform/qt/plugins/application-plugin-plugins-disabled.html: * platform/win/plugins/call-javascript-that-destroys-plugin.html: * platform/win/plugins/get-value-netscape-window.html: * platform/win/plugins/iframe-inside-overflow.html: * platform/win/plugins/npn-invalidate-rect-invalidates-window.html: * platform/win/plugins/visibility-hidden.html: * platform/win/plugins/window-geometry-initialized-before-set-window.html: * platform/win/plugins/window-region-is-set-to-clip-rect.html: * platform/win/plugins/windowless-paint-rect-coordinates.html: * plugins/: * pointer-lock/lock-fail-responses-expected.txt: * pointer-lock/lock-fail-responses.html: * pointer-lock/pointer-lock-api.html: * pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt: * pointer-lock/pointerlockchange-pointerlockerror-events.html: * pointer-lock/pointerlocklost-event-expected.txt: * pointer-lock/pointerlocklost-event.html: * printing/compositing-layer-printing.html: * printing/css2.1/README.txt: * printing/css2.1/page-break-after-000.html: * printing/css2.1/page-break-after-001.html: * printing/css2.1/page-break-after-002.html: * printing/css2.1/page-break-after-003.html: * printing/css2.1/page-break-after-004.html: * printing/css2.1/page-break-before-000.html: * printing/css2.1/page-break-before-001.html: * printing/css2.1/page-break-before-002.html: * printing/css2.1/page-break-inside-000.html: * printing/iframe-print.html: * printing/media-queries-print.html: * printing/numberOfPages-expected.txt: * printing/page-count-layout-overflow.html: * printing/page-count-relayout-shrink.html: * printing/page-count-with-one-word.html: * printing/page-format-data-display-none.html: * printing/page-format-data-expected.txt: * printing/page-format-data.html: * printing/page-rule-css-text.html: * printing/page-rule-in-media-query.html: * printing/page-rule-selection-expected.txt: * printing/page-rule-selection.html: * printing/pageNumerForElementById-expected.txt: * printing/print-close-crash.html: * printing/pseudo-class-outside-page.html: * printing/resources/paged-media-test-utils.js: (pageNumberForElementShouldBe): (numberOfPagesShouldBe): (runPrintingTest): * printing/return-from-printing-mode.html: * printing/script-tests/numberOfPages.js: * printing/script-tests/pageNumerForElementById.js: * printing/setPrinting.html: * printing/simultaneous-position-float-change.html: * printing/single-line-must-not-be-split-into-two-pages.html: * printing/width-overflow.html: * printing/zoomed-document.html: * scrollbars/hidden-iframe-scrollbar-crash.html: * scrollbars/hidden-iframe-scrollbar-crash2.html: * scrollbars/hidden-scrollbar-prevents-layout.html: * scrollbars/overflow-custom-scrollbar-crash.html: * scrollbars/resources/hidden-iframe-scrollbar-crash2.html: * scrollbars/scroll-rtl-or-bt-layer.html: * scrollbars/scrollable-iframe-remove-crash.html: * scrollbars/scrollbar-click-does-not-blur-content.html: * scrollbars/scrollbar-crash-on-refresh.html: * scrollbars/scrollbar-drag-thumb-with-large-content.html: * scrollbars/scrollbar-gradient-crash.html: * scrollbars/scrollbar-iframe-click-does-not-blur-content.html: * scrollbars/scrollbar-initial-position.html: * scrollbars/scrollbar-middleclick-nopaste.html: * scrollbars/scrollbar-miss-mousemove-disabled.html: * scrollbars/scrollbar-miss-mousemove.html: * scrollbars/scrollbar-owning-renderer-crash.html: * scrollbars/scrollbar-part-created-with-no-parent-crash.html: * scrollbars/scrollbar-percent-padding-crash.html: * scrollbars/scrollbar-scrollbarparts-repaint-crash.html: * scrollbars/scrollevent-iframe-no-scrolling-wheel.html: * scrollbars/scrollevent-iframe-no-scrolling.html: * security/autocomplete-cleared-on-back.html: * security/block-test-no-port.html: * security/block-test.html: * security/set-form-autocomplete-attribute.html: Canonical link: https://commits.webkit.org/107031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-15 07:38:37 +00:00
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
2009-11-12 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. The document-html and window-html tests don't use a setTimeout to notify that the test is completed. The layout test plugin now issues the notifyDone call via javascript. https://bugs.webkit.org/show_bug.cgi?id=31067 * plugins/document-open.html: * plugins/window-open.html: 2009-11-12 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. The document-open.html test was flaky at times. The test invokes the layout test plugin which in its destroy stream handler opens a new document. This basically tears down the stream and the associated plugin instance, which causes a crash when the plugin stream dereferences an invalid m_client pointer which points to the PluginView instance which is invalid at this time. Fix is to set the m_client pointer to NULL in the stop function and check for the same. https://bugs.webkit.org/show_bug.cgi?id=31067 * plugins/PluginStream.cpp: (WebCore::PluginStream::stop): (WebCore::PluginStream::destroyStream): 2009-11-12 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. The document-open.html test was flaky at times. The test invokes the layout test plugin which in its destroy stream handler opens a new document. This basically tears down the stream and the associated plugin instance. The pluginLog function in the layout test plugin attempts to retrieve the window script object on a torn down plugin instance which crashed consistently on windows in the debugger. The functions which issue these logs already have a valid window script object. We now have variants of the pluginLog function which take in a window script object with and without variable arguments. https://bugs.webkit.org/show_bug.cgi?id=31067 * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (pluginLogWithWindowObject): (pluginLogWithWindowObjectVariableArgs): (pluginLog): (notifyTestCompletion): (testDocumentOpen): (testWindowOpen): Canonical link: https://commits.webkit.org/42358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2009-11-13 06:42:43 +00:00
}
2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. Added layout tests to test document.open and window.open calls issued by NPAPI plugins without a calling javascript context. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. * plugins/document-open-expected.txt: Added. * plugins/document-open.html: Added. * plugins/window-open-expected.txt: Added. * plugins/window-open.html: Added. 2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium only. Changes to V8HTMLDocumentCustom.cpp are as below:- 1. The HTMLDocumentOpen function would cause a crash in Chromium if there was no calling javascript context. We now check for this case and pass in NULL to the HTMLDocument::open function which can handle a NULL document parameter. 2. The other functions like HTMLDocumentWrite, HTMLDocumentWriteln, etc had ASSERTS for a NULL caller frame, which was bogus as it would crash anyway. We now check for this case and return a failure. Changes to V8DOMWindowCustom.cpp are as below:- 1. Instead of failing the window.open call made by NPAPI for lack of a calling javascript context, we now use the entered context as the calling context. Tests: plugins/document-open.html plugins/window-open.html * bindings/v8/custom/V8DOMWindowCustom.cpp: (WebCore::CALLBACK_FUNC_DECL): * bindings/v8/custom/V8HTMLDocumentCustom.cpp: (WebCore::CALLBACK_FUNC_DECL): 2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org> Reviewed by Adam Barth. Added functionality to the layout test plugin to invoke document.open and window.open with default arguments. The associated webkit bug is https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. Basically window.open and document.open calls issued by NPAPI plugins via NPN_Invoke don't work in Chromium (V8) if there is no calling javascript context. To achieve this effect we invoke these functions in the layout test plugin in the NPP_SetWindow for the window.open test case and in NPP_DestroyStream for the document.open test case. * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (testDocumentOpen): (testWindowOpen): (pluginAllocate): * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: (NPP_New): (NPP_SetWindow): (NPP_DestroyStream): * DumpRenderTree/win/TestNetscapePlugin/main.cpp: (NPP_New): (NPP_SetWindow): (NPP_NewStream): (NPP_DestroyStream): Canonical link: https://commits.webkit.org/42037@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2009-11-06 23:00:44 +00:00
</script>
</body>
</html>