From 0e37edb4729164c0d9034b476c65ccb69f7985d0 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Tue, 2 Feb 2010 18:57:15 -0800 Subject: [PATCH] Backed out changeset 8006ad2d0c06 (tests for bug 542263), since its test 'test_GCrace.html' failed on OSX in its first cycle. --- build/automation.py.in | 5 +- modules/plugin/test/mochitest/Makefile.in | 1 - .../plugin/test/mochitest/test_GCrace.html | 59 ------------ modules/plugin/test/testplugin/README | 4 - modules/plugin/test/testplugin/nptest.cpp | 96 ------------------- 5 files changed, 4 insertions(+), 161 deletions(-) delete mode 100644 modules/plugin/test/mochitest/test_GCrace.html diff --git a/build/automation.py.in b/build/automation.py.in index e344cbe24a9..7796837a4cb 100644 --- a/build/automation.py.in +++ b/build/automation.py.in @@ -468,7 +468,10 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t return env if IS_WIN32: - import ctypes, ctypes.wintypes, time, msvcrt + ctypes = __import__('ctypes') + wintypes = __import__('ctypes.wintypes') + time = __import__('time') + msvcrt = __import__('msvcrt') PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe GetLastError = ctypes.windll.kernel32.GetLastError diff --git a/modules/plugin/test/mochitest/Makefile.in b/modules/plugin/test/mochitest/Makefile.in index 999b593b6ef..5ac19f15e1a 100644 --- a/modules/plugin/test/mochitest/Makefile.in +++ b/modules/plugin/test/mochitest/Makefile.in @@ -72,7 +72,6 @@ _MOCHITEST_FILES = \ test_cookies.html \ test_npn_timers.html \ test_npn_asynccall.html \ - test_GCrace.html \ $(NULL) # test_npruntime_npnsetexception.html \ Disabled for e10s diff --git a/modules/plugin/test/mochitest/test_GCrace.html b/modules/plugin/test/mochitest/test_GCrace.html deleted file mode 100644 index 40e4f04e14d..00000000000 --- a/modules/plugin/test/mochitest/test_GCrace.html +++ /dev/null @@ -1,59 +0,0 @@ - - GC race with actors on the parent - - - - - -

- - - - diff --git a/modules/plugin/test/testplugin/README b/modules/plugin/test/testplugin/README index 192177a08c9..11a44e3e6a7 100644 --- a/modules/plugin/test/testplugin/README +++ b/modules/plugin/test/testplugin/README @@ -94,10 +94,6 @@ with a boolean value, indicating whether the tests were successful. NPN_PluginThreadAsyncCall. When finished, calls the script callback with a boolean value, indicating whether the tests were successful. -* checkGCRace(callback) - return a function NPObject which may be called - with the number '35'. Immediately after returning, sleep for 5 seconds, then - call "callback" with the same NPObject. - == Private browsing == The test plugin object supports the following scriptable methods: diff --git a/modules/plugin/test/testplugin/nptest.cpp b/modules/plugin/test/testplugin/nptest.cpp index 860130d6567..393eeebe346 100644 --- a/modules/plugin/test/testplugin/nptest.cpp +++ b/modules/plugin/test/testplugin/nptest.cpp @@ -46,7 +46,6 @@ #ifdef XP_WIN #include #include -#include #define getpid _getpid #else #include @@ -145,7 +144,6 @@ static bool setCookie(NPObject* npobj, const NPVariant* args, uint32_t argCount, static bool getCookie(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool getAuthInfo(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool asyncCallbackTest(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); -static bool checkGCRace(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static const NPUTF8* sPluginMethodIdentifierNames[] = { "npnEvaluateTest", @@ -183,7 +181,6 @@ static const NPUTF8* sPluginMethodIdentifierNames[] = { "getCookie", "getAuthInfo", "asyncCallbackTest", - "checkGCRace", }; static NPIdentifier sPluginMethodIdentifiers[ARRAY_LENGTH(sPluginMethodIdentifierNames)]; static const ScriptableFunction sPluginMethodFunctions[ARRAY_LENGTH(sPluginMethodIdentifierNames)] = { @@ -222,7 +219,6 @@ static const ScriptableFunction sPluginMethodFunctions[ARRAY_LENGTH(sPluginMetho getCookie, getAuthInfo, asyncCallbackTest, - checkGCRace, }; struct URLNotifyData @@ -2454,95 +2450,3 @@ asyncCallbackTest(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPV return true; } - -static bool -GCRaceInvokeDefault(NPObject* o, const NPVariant* args, uint32_t argCount, - NPVariant* result) -{ - if (1 != argCount || !NPVARIANT_IS_INT32(args[0]) || - 35 != NPVARIANT_TO_INT32(args[0])) - return false; - - return true; -} - -static const NPClass kGCRaceClass = { - NP_CLASS_STRUCT_VERSION, - NULL, - NULL, - NULL, - NULL, - NULL, - GCRaceInvokeDefault, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -struct GCRaceData -{ - GCRaceData(NPP npp, NPObject* callback, NPObject* localFunc) - : npp_(npp) - , callback_(callback) - , localFunc_(localFunc) - { - NPN_RetainObject(callback_); - NPN_RetainObject(localFunc_); - } - - ~GCRaceData() - { - NPN_ReleaseObject(callback_); - NPN_ReleaseObject(localFunc_); - } - - NPP npp_; - NPObject* callback_; - NPObject* localFunc_; -}; - -static void -FinishGCRace(void* closure) -{ - GCRaceData* rd = static_cast(closure); - -#ifdef XP_WIN - Sleep(5000); -#else - sleep(5); -#endif - - NPVariant arg; - OBJECT_TO_NPVARIANT(rd->localFunc_, arg); - - NPVariant result; - bool ok = NPN_InvokeDefault(rd->npp_, rd->callback_, &arg, 1, &result); - if (!ok) - return; - - NPN_ReleaseVariantValue(&result); - delete rd; -} - -bool -checkGCRace(NPObject* npobj, const NPVariant* args, uint32_t argCount, - NPVariant* result) -{ - if (1 != argCount || !NPVARIANT_IS_OBJECT(args[0])) - return false; - - NPP npp = static_cast(npobj)->npp; - - NPObject* localFunc = - NPN_CreateObject(npp, const_cast(&kGCRaceClass)); - - GCRaceData* rd = - new GCRaceData(npp, NPVARIANT_TO_OBJECT(args[0]), localFunc); - NPN_PluginThreadAsyncCall(npp, FinishGCRace, rd); - - OBJECT_TO_NPVARIANT(localFunc, *result); - return true; -}