Backed out changeset c78f97c0b771 (bug 1314955)

This commit is contained in:
Iris Hsiao 2016-11-16 15:19:46 +08:00
Родитель 66ac15df36
Коммит 5f1776f800
7 изменённых файлов: 9 добавлений и 30 удалений

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

@ -28,7 +28,6 @@
#include "nsJSPrincipals.h" #include "nsJSPrincipals.h"
#include "xpcpublic.h" #include "xpcpublic.h"
#include "xpcprivate.h" #include "xpcprivate.h"
#include "xpctest_private.h"
#include "BackstagePass.h" #include "BackstagePass.h"
#include "nsIScriptSecurityManager.h" #include "nsIScriptSecurityManager.h"
#include "nsIPrincipal.h" #include "nsIPrincipal.h"
@ -644,22 +643,6 @@ RegisterAppManifest(JSContext* cx, unsigned argc, Value* vp)
return true; return true;
} }
static bool
RegisterXPCTestComponents(JSContext* cx, unsigned argc, Value* vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
if (args.length() != 0) {
JS_ReportErrorASCII(cx, "Wrong number of arguments");
return false;
}
nsresult rv = XRE_AddStaticComponent(&kXPCTestModule);
if (NS_FAILED(rv)) {
XPCThrower::Throw(rv, cx);
return false;
}
return true;
}
static const JSFunctionSpec glob_functions[] = { static const JSFunctionSpec glob_functions[] = {
JS_FS("print", Print, 0,0), JS_FS("print", Print, 0,0),
JS_FS("readline", ReadLine, 1,0), JS_FS("readline", ReadLine, 1,0),
@ -679,7 +662,6 @@ static const JSFunctionSpec glob_functions[] = {
JS_FS("setInterruptCallback", SetInterruptCallback, 1,0), JS_FS("setInterruptCallback", SetInterruptCallback, 1,0),
JS_FS("simulateActivityCallback", SimulateActivityCallback, 1,0), JS_FS("simulateActivityCallback", SimulateActivityCallback, 1,0),
JS_FS("registerAppManifest", RegisterAppManifest, 1, 0), JS_FS("registerAppManifest", RegisterAppManifest, 1, 0),
JS_FS("registerXPCTestComponents", RegisterXPCTestComponents, 0, 0),
JS_FS_END JS_FS_END
}; };

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

@ -4,10 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXPORTS += [ FINAL_TARGET = '_tests/xpcshell/js/xpconnect/tests/components/native/'
'xpctest_private.h',
]
EXTRA_COMPONENTS += [ EXTRA_COMPONENTS += [
'xpctest.manifest', 'xpctest.manifest',
] ]
@ -19,4 +16,4 @@ UNIFIED_SOURCES += [
'xpctest_returncode.cpp', 'xpctest_returncode.cpp',
] ]
FINAL_LIBRARY = 'xul' XPCOMBinaryComponent('xpctest')

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

@ -6,6 +6,7 @@
/* module registration and factory code. */ /* module registration and factory code. */
#include "mozilla/ModuleUtils.h"
#include "xpctest_private.h" #include "xpctest_private.h"
#define NS_XPCTESTOBJECTREADONLY_CID \ #define NS_XPCTESTOBJECTREADONLY_CID \
@ -49,8 +50,10 @@ static const mozilla::Module::ContractIDEntry kXPCTestContracts[] = {
{ nullptr } { nullptr }
}; };
const mozilla::Module kXPCTestModule = { static const mozilla::Module kXPCTestModule = {
mozilla::Module::kVersion, mozilla::Module::kVersion,
kXPCTestCIDs, kXPCTestCIDs,
kXPCTestContracts kXPCTestContracts
}; };
NSMODULE_DEFN(xpconnect_test) = &kXPCTestModule;

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

@ -16,9 +16,6 @@
#include "xpctest_params.h" #include "xpctest_params.h"
#include "xpctest_returncode.h" #include "xpctest_returncode.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/ModuleUtils.h"
extern const mozilla::Module kXPCTestModule;
class xpcTestObjectReadOnly final : public nsIXPCTestObjectReadOnly { class xpcTestObjectReadOnly final : public nsIXPCTestObjectReadOnly {
public: public:

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

@ -8,7 +8,7 @@ const Ci = Components.interfaces;
function run_test() { function run_test() {
// Load the component manifests. // Load the component manifests.
registerXPCTestComponents(); registerAppManifest(do_get_file('../components/native/chrome.manifest'));
registerAppManifest(do_get_file('../components/js/xpctest.manifest')); registerAppManifest(do_get_file('../components/js/xpctest.manifest'));
// Test for each component. // Test for each component.

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

@ -8,7 +8,7 @@ const Ci = Components.interfaces;
function run_test() { function run_test() {
// Load the component manifests. // Load the component manifests.
registerXPCTestComponents(); registerAppManifest(do_get_file('../components/native/chrome.manifest'));
registerAppManifest(do_get_file('../components/js/xpctest.manifest')); registerAppManifest(do_get_file('../components/js/xpctest.manifest'));
// Test for each component. // Test for each component.

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

@ -16,7 +16,7 @@ function getConsoleMessages() {
function run_test() { function run_test() {
// Load the component manifests. // Load the component manifests.
registerXPCTestComponents(); registerAppManifest(do_get_file('../components/native/chrome.manifest'));
registerAppManifest(do_get_file('../components/js/xpctest.manifest')); registerAppManifest(do_get_file('../components/js/xpctest.manifest'));
// and the tests. // and the tests.