Bug 1363538 - Remove some derelict testing code from XPCShellImpl.cpp. r=mrbkap

MozReview-Commit-ID: 96UyB317H0W

--HG--
extra : source : 0a74ed4854d784856f28cf48a422f4aa0763fd22
This commit is contained in:
Andrew McCreight 2017-05-09 14:35:23 -07:00
Родитель c692a27e9b
Коммит 087c406acb
1 изменённых файлов: 0 добавлений и 83 удалений

Просмотреть файл

@ -1173,76 +1173,6 @@ ProcessArgs(AutoJSAPI& jsapi, char** argv, int argc, XPCShellDirProvider* aDirPr
/***************************************************************************/
// #define TEST_InitClassesWithNewWrappedGlobal
#ifdef TEST_InitClassesWithNewWrappedGlobal
// XXX hacky test code...
#include "xpctest.h"
class TestGlobal : public nsIXPCTestNoisy, public nsIXPCScriptable
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIXPCTESTNOISY
NS_DECL_NSIXPCSCRIPTABLE
TestGlobal(){}
};
NS_IMPL_ISUPPORTS(TestGlobal, nsIXPCTestNoisy, nsIXPCScriptable)
// The nsIXPCScriptable map declaration that will generate stubs for us...
#define XPC_MAP_CLASSNAME TestGlobal
#define XPC_MAP_QUOTED_CLASSNAME "TestGlobal"
#define XPC_MAP_FLAGS (XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY |\
XPC_SCRIPTABLE_USE_JSSTUB_FOR_DELPROPERTY |\
XPC_SCRIPTABLE_USE_JSSTUB_FOR_SETPROPERTY)
#include "xpc_map_end.h" /* This will #undef the above */
NS_IMETHODIMP TestGlobal::Squawk() {return NS_OK;}
#endif
// uncomment to install the test 'this' translator
// #define TEST_TranslateThis
#ifdef TEST_TranslateThis
#include "xpctest.h"
class nsXPCFunctionThisTranslator : public nsIXPCFunctionThisTranslator
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR
nsXPCFunctionThisTranslator();
virtual ~nsXPCFunctionThisTranslator();
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsXPCFunctionThisTranslator, nsIXPCFunctionThisTranslator)
nsXPCFunctionThisTranslator::nsXPCFunctionThisTranslator()
{
}
nsXPCFunctionThisTranslator::~nsXPCFunctionThisTranslator()
{
}
NS_IMETHODIMP
nsXPCFunctionThisTranslator::TranslateThis(nsISupports* aInitialThis,
nsISupports** _retval)
{
nsCOMPtr<nsISupports> temp = aInitialThis;
temp.forget(_retval);
return NS_OK;
}
#endif
static bool
GetCurrentWorkingDirectory(nsAString& workingDirectory)
{
@ -1508,12 +1438,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp,
shellSecurityCallbacks = *scb;
JS_SetSecurityCallbacks(cx, &shellSecurityCallbacks);
#ifdef TEST_TranslateThis
nsCOMPtr<nsIXPCFunctionThisTranslator>
translator(new nsXPCFunctionThisTranslator);
xpc->SetFunctionThisTranslator(NS_GET_IID(nsITestXPCFunctionCallback), translator);
#endif
RefPtr<BackstagePass> backstagePass;
rv = NS_NewBackstagePass(getter_AddRefs(backstagePass));
if (NS_FAILED(rv)) {
@ -1639,13 +1563,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp,
rv = NS_ShutdownXPCOM( nullptr );
MOZ_ASSERT(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
#ifdef TEST_CALL_ON_WRAPPED_JS_AFTER_SHUTDOWN
// test of late call and release (see above)
JSContext* bogusCX;
bogus->Peek(&bogusCX);
bogus = nullptr;
#endif
telStats = nullptr;
#ifdef MOZ_CRASHREPORTER