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:
Benjamin Smedberg 2016-11-16 12:28:57 -05:00
Родитель 067ef5e9f7
Коммит ef89ac1033
9 изменённых файлов: 30 добавлений и 15 удалений

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

@ -28,6 +28,7 @@
#include "nsJSPrincipals.h"
#include "xpcpublic.h"
#include "xpcprivate.h"
#include "xpctest_private.h"
#include "BackstagePass.h"
#include "nsIScriptSecurityManager.h"
#include "nsIPrincipal.h"
@ -643,6 +644,22 @@ RegisterAppManifest(JSContext* cx, unsigned argc, Value* vp)
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[] = {
JS_FS("print", Print, 0,0),
JS_FS("readline", ReadLine, 1,0),
@ -662,6 +679,7 @@ static const JSFunctionSpec glob_functions[] = {
JS_FS("setInterruptCallback", SetInterruptCallback, 1,0),
JS_FS("simulateActivityCallback", SimulateActivityCallback, 1,0),
JS_FS("registerAppManifest", RegisterAppManifest, 1, 0),
JS_FS("registerXPCTestComponents", RegisterXPCTestComponents, 0, 0),
JS_FS_END
};

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

@ -4,7 +4,10 @@
# 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/.
FINAL_TARGET = '_tests/xpcshell/js/xpconnect/tests/components/native/'
EXPORTS += [
'xpctest_private.h',
]
EXTRA_COMPONENTS += [
'xpctest.manifest',
]
@ -16,4 +19,4 @@ UNIFIED_SOURCES += [
'xpctest_returncode.cpp',
]
XPCOMBinaryComponent('xpctest')
FINAL_LIBRARY = 'xul'

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

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

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

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

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

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

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

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

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

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

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

@ -89,11 +89,7 @@ fail-if = os == "android"
[test_xpcomutils.js]
[test_unload.js]
[test_attributes.js]
# Bug 676965: test fails consistently on Android
fail-if = os == "android"
[test_params.js]
# Bug 676965: test fails consistently on Android
fail-if = os == "android"
[test_tearoffs.js]
[test_want_components.js]
[test_components.js]
@ -104,7 +100,6 @@ fail-if = os == "android"
[test_exportFunction.js]
[test_promise.js]
[test_returncode.js]
skip-if = os == "android" # native test components aren't available on Android
[test_textDecoder.js]
[test_url.js]
[test_URLSearchParams.js]

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

@ -123,7 +123,6 @@ ALLOWED_XPCOM_GLUE = {
('TestCookie', 'netwerk/test'),
('TestUDPSocket', 'netwerk/test'),
('xpcshell', 'js/xpconnect/shell'),
('xpctest', 'js/xpconnect/tests/components/native'),
('test_AsXXX_helpers', 'storage/test'),
('test_async_callbacks_with_spun_event_loops', 'storage/test'),
('test_asyncStatementExecution_transaction', 'storage/test'),