diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 21:14:54 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 21:14:54 +0000 |
commit | 21a3785836bac48f12af3175415df61b8dfdab56 (patch) | |
tree | 0dfc2b88196317dc471f8f9a4cc28ad4cd5fa8dc /webkit | |
parent | 7c7da82d4b2f1e918ddeff9218545bec98184f84 (diff) | |
download | chromium_src-21a3785836bac48f12af3175415df61b8dfdab56.zip chromium_src-21a3785836bac48f12af3175415df61b8dfdab56.tar.gz chromium_src-21a3785836bac48f12af3175415df61b8dfdab56.tar.bz2 |
Fixes the following layout tests.
1. LayoutTests\plugins\netscape-plugin-setwindow-size.html
2. LayoutTests\plugins\destroy-stream-twice.html.
The fix for the first test was to get our NPP_SetWindow implementation in the layout test plugin on par with webkit's implementation. I also added a fflush(stdout) to make sure that the printf shows up. If we don't do this the test fails often.
The fix for the second test is to get our NPP_DestroyStream implementation in the layout test plugin on par with webkit's implementation. With the latest webkit update, there is a destroyNullStream test which has been added in this layout test. The layout test plugin had to be updated with this new method on the same lines as its counterpart in webkit.
Review URL: http://codereview.chromium.org/39242
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/layout_tests/test_lists/tests_fixable.txt | 15 | ||||
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/PluginObject.cpp | 20 | ||||
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/main.cpp | 7 |
3 files changed, 17 insertions, 25 deletions
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 345b4ad..69131a1 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -118,10 +118,6 @@ DEFER : LayoutTests/fast/events/stopPropagation-submit.html = FAIL // See https://bugs.webkit.org/show_bug.cgi?id=21536 DEFER : LayoutTests/fast/repaint/bugzilla-6473.html = PASS FAIL -// Bug 982608: test had a wrong result for one condition -// Pending test needs work before sending upstream. -DEFER : LayoutTests/plugins/destroy-stream-twice.html = FAIL TIMEOUT - // ----------------------------------------------------------------- // Tests deferred until we provide support for a particular feature. // ----------------------------------------------------------------- @@ -195,11 +191,6 @@ DEFER : LayoutTests/plugins/netscape-enumerate.html = FAIL // The test must be fixed to not depend on user settings and rebaselined. post-beta. DEFER : LayoutTests/fast/dom/Window/window-screen-properties.html = PASS FAIL -// Bug: 849060 -// Plugin creation is delayed until after first layout, so -// setwindow isn't being called. -LayoutTests/plugins/netscape-plugin-setwindow-size.html = FAIL - // Expectations for this test changed upstream. We should fix this test, but // it doesn't need to block the current release DEFER : LayoutTests/http/tests/security/cross-frame-access-put.html = FAIL @@ -967,12 +958,6 @@ LayoutTests/security/block-test.html = FAIL // Missing expected results SKIP LINUX MAC : LayoutTests/animations/animation-drt-api.html = PASS -// MERGE 38600:38625: New tests -// Big 4999: we need to fix this same bug in our plugin handling Apple did in -// r38611. -// New test. We should fix it, but it doesn't need to block the current release -DEFER : LayoutTests/plugins/netscape-plugin-setwindow-size-2.html = FAIL - // MERGE 38625:38653: Expectations changed upstream MAC : LayoutTests/fast/css/computed-style-without-renderer.html = FAIL diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp index afcb60f..2bfab8f 100644 --- a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp +++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp @@ -107,7 +107,8 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = { #define ID_TEST_POSTURL_FILE 19 #define ID_TEST_CALLBACK_AND_GET_VALUE 20 #define ID_TEST_CONSTRUCT 21 -#define NUM_METHOD_IDENTIFIERS 22 +#define ID_DESTROY_NULL_STREAM 22 +#define NUM_METHOD_IDENTIFIERS 23 static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS]; static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { @@ -134,6 +135,7 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { // Chrome bug http://code.google.com/p/chromium/issues/detail?id=4270 "testCallbackAndGetValue", "testConstruct", + "destroyNullStream", }; static NPUTF8* createCStringFromNPVariant(const NPVariant* variant) @@ -410,6 +412,13 @@ static bool destroyStream(PluginObject* obj, const NPVariant* args, uint32_t arg return true; } +static bool destroyNullStream(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + NPError npError = browser->destroystream(obj->npp, 0, NPRES_USER_BREAK); + INT32_TO_NPVARIANT(npError, *result); + return true; +} + static bool testEnumerate(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) { if (argCount == 2 && NPVARIANT_IS_OBJECT(args[0]) && NPVARIANT_IS_OBJECT(args[1])) { @@ -736,11 +745,12 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a return true; } } else if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_AND_GET_VALUE]) { - return testCallbackAndGetValue(plugin, args, argCount, result); + return testCallbackAndGetValue(plugin, args, argCount, result); } else if (name == pluginMethodIdentifiers[ID_TEST_CONSTRUCT]) { - return testConstruct(plugin, args, argCount, result); - } - + return testConstruct(plugin, args, argCount, result); + } else if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM]) + return destroyNullStream(plugin, args, argCount, result); + return false; } diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp index 65426c0..c18ee6a 100644 --- a/webkit/tools/npapi_layout_test_plugin/main.cpp +++ b/webkit/tools/npapi_layout_test_plugin/main.cpp @@ -138,15 +138,12 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) NPError NPP_SetWindow(NPP instance, NPWindow *window) { - if (window->window == NULL) { - return NPERR_NO_ERROR; - } - PluginObject* obj = static_cast<PluginObject*>(instance->pdata); if (obj) { if (obj->logSetWindow) { printf("PLUGIN: NPP_SetWindow: %d %d\n", (int)window->width, (int)window->height); + fflush(stdout); obj->logSetWindow = false; } } @@ -190,9 +187,9 @@ NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool se NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); + if (obj->onStreamDestroy) executeScript(obj, obj->onStreamDestroy); - obj->stream = 0; return NPERR_NO_ERROR; } |