зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1314955 part A - Move the binary xpconnect testing components into libxul so that we can remove support for external binary components. Ideally we'd only compile these into the xul-gtest version, but currently we can't run xpcshell tests against that version, so I'm going to put them into the release xul, r=mrbkap
MozReview-Commit-ID: Lr6uKtzXdEb --HG-- extra : rebase_source : d6c813e568ba62bcc7174a0fc990ccf4364717e6 extra : source : c78f97c0b77126fa37c857728192f2e2d0c2d99c
This commit is contained in:
Родитель
067ef5e9f7
Коммит
ef89ac1033
|
@ -28,6 +28,7 @@
|
||||||
#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"
|
||||||
|
@ -643,6 +644,22 @@ 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),
|
||||||
|
@ -662,6 +679,7 @@ 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,7 +4,10 @@
|
||||||
# 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/.
|
||||||
|
|
||||||
FINAL_TARGET = '_tests/xpcshell/js/xpconnect/tests/components/native/'
|
EXPORTS += [
|
||||||
|
'xpctest_private.h',
|
||||||
|
]
|
||||||
|
|
||||||
EXTRA_COMPONENTS += [
|
EXTRA_COMPONENTS += [
|
||||||
'xpctest.manifest',
|
'xpctest.manifest',
|
||||||
]
|
]
|
||||||
|
@ -16,4 +19,4 @@ UNIFIED_SOURCES += [
|
||||||
'xpctest_returncode.cpp',
|
'xpctest_returncode.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
XPCOMBinaryComponent('xpctest')
|
FINAL_LIBRARY = 'xul'
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
/* 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 \
|
||||||
|
@ -50,10 +49,8 @@ static const mozilla::Module::ContractIDEntry kXPCTestContracts[] = {
|
||||||
{ nullptr }
|
{ nullptr }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const mozilla::Module kXPCTestModule = {
|
const mozilla::Module kXPCTestModule = {
|
||||||
mozilla::Module::kVersion,
|
mozilla::Module::kVersion,
|
||||||
kXPCTestCIDs,
|
kXPCTestCIDs,
|
||||||
kXPCTestContracts
|
kXPCTestContracts
|
||||||
};
|
};
|
||||||
|
|
||||||
NSMODULE_DEFN(xpconnect_test) = &kXPCTestModule;
|
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
#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.
|
||||||
registerAppManifest(do_get_file('../components/native/chrome.manifest'));
|
registerXPCTestComponents();
|
||||||
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.
|
||||||
registerAppManifest(do_get_file('../components/native/chrome.manifest'));
|
registerXPCTestComponents();
|
||||||
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.
|
||||||
registerAppManifest(do_get_file('../components/native/chrome.manifest'));
|
registerXPCTestComponents();
|
||||||
registerAppManifest(do_get_file('../components/js/xpctest.manifest'));
|
registerAppManifest(do_get_file('../components/js/xpctest.manifest'));
|
||||||
|
|
||||||
// and the tests.
|
// and the tests.
|
||||||
|
|
|
@ -89,11 +89,7 @@ fail-if = os == "android"
|
||||||
[test_xpcomutils.js]
|
[test_xpcomutils.js]
|
||||||
[test_unload.js]
|
[test_unload.js]
|
||||||
[test_attributes.js]
|
[test_attributes.js]
|
||||||
# Bug 676965: test fails consistently on Android
|
|
||||||
fail-if = os == "android"
|
|
||||||
[test_params.js]
|
[test_params.js]
|
||||||
# Bug 676965: test fails consistently on Android
|
|
||||||
fail-if = os == "android"
|
|
||||||
[test_tearoffs.js]
|
[test_tearoffs.js]
|
||||||
[test_want_components.js]
|
[test_want_components.js]
|
||||||
[test_components.js]
|
[test_components.js]
|
||||||
|
@ -104,7 +100,6 @@ fail-if = os == "android"
|
||||||
[test_exportFunction.js]
|
[test_exportFunction.js]
|
||||||
[test_promise.js]
|
[test_promise.js]
|
||||||
[test_returncode.js]
|
[test_returncode.js]
|
||||||
skip-if = os == "android" # native test components aren't available on Android
|
|
||||||
[test_textDecoder.js]
|
[test_textDecoder.js]
|
||||||
[test_url.js]
|
[test_url.js]
|
||||||
[test_URLSearchParams.js]
|
[test_URLSearchParams.js]
|
||||||
|
|
|
@ -123,7 +123,6 @@ ALLOWED_XPCOM_GLUE = {
|
||||||
('TestCookie', 'netwerk/test'),
|
('TestCookie', 'netwerk/test'),
|
||||||
('TestUDPSocket', 'netwerk/test'),
|
('TestUDPSocket', 'netwerk/test'),
|
||||||
('xpcshell', 'js/xpconnect/shell'),
|
('xpcshell', 'js/xpconnect/shell'),
|
||||||
('xpctest', 'js/xpconnect/tests/components/native'),
|
|
||||||
('test_AsXXX_helpers', 'storage/test'),
|
('test_AsXXX_helpers', 'storage/test'),
|
||||||
('test_async_callbacks_with_spun_event_loops', 'storage/test'),
|
('test_async_callbacks_with_spun_event_loops', 'storage/test'),
|
||||||
('test_asyncStatementExecution_transaction', 'storage/test'),
|
('test_asyncStatementExecution_transaction', 'storage/test'),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче