зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset a99c6ce96b6f (bug 1314955)
This commit is contained in:
Родитель
541087209a
Коммит
66ac15df36
|
@ -0,0 +1,32 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
|
||||
// f18fb09b-28b4-4435-bc5b-8027f18df743
|
||||
#define NS_TESTING_CID \
|
||||
{ 0xf18fb09b, 0x28b4, 0x4435, \
|
||||
{ 0xbc, 0x5b, 0x80, 0x27, 0xf1, 0x8d, 0xf7, 0x43 } }
|
||||
|
||||
NS_DEFINE_NAMED_CID(NS_TESTING_CID);
|
||||
|
||||
static nsresult
|
||||
DummyConstructorFunc(nsISupports* aOuter, const nsIID& aIID, void** aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static const mozilla::Module::CIDEntry kTestCIDs[] = {
|
||||
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module kTestModule = {
|
||||
3, /* faking mozilla::Module::kVersion with a value that will never be used */
|
||||
kTestCIDs
|
||||
};
|
||||
|
||||
NSMODULE_DEFN(dummy) = &kTestModule;
|
|
@ -0,0 +1,2 @@
|
|||
#filter substitution
|
||||
binary-component @LIBRARY_FILENAME@
|
|
@ -0,0 +1,26 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# 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/xpcom/tests/unit'
|
||||
EXTRA_PP_COMPONENTS += [
|
||||
'bug656331.manifest',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'TestComponent.cpp',
|
||||
]
|
||||
|
||||
XPCOMBinaryComponent('test656331')
|
||||
|
||||
DEFINES['LIBRARY_FILENAME'] = '%s%s%s' % (
|
||||
CONFIG['DLL_PREFIX'],
|
||||
LIBRARY_NAME,
|
||||
CONFIG['DLL_SUFFIX']
|
||||
)
|
||||
|
||||
# Need to link with CoreFoundation on Mac
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
OS_LIBS += CONFIG['TK_LIBS']
|
|
@ -0,0 +1,44 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
|
||||
#define NS_TESTING_CID \
|
||||
{ 0x335fb596, 0xe52d, 0x418f, \
|
||||
{ 0xb0, 0x1c, 0x1b, 0xf1, 0x6c, 0xe5, 0xe7, 0xe4 } }
|
||||
#define NS_NONEXISTENT_CID \
|
||||
{ 0x1e61fb15, 0xead4, 0x45cd, \
|
||||
{ 0x80, 0x13, 0x40, 0x99, 0xa7, 0x10, 0xa2, 0xfa } }
|
||||
|
||||
NS_DEFINE_NAMED_CID(NS_TESTING_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_NONEXISTENT_CID);
|
||||
|
||||
static nsresult
|
||||
DummyConstructorFunc(nsISupports* aOuter, const nsIID& aIID, void** aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static const mozilla::Module::CIDEntry kTestCIDs[] = {
|
||||
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
|
||||
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module::ContractIDEntry kTestContractIDs[] = {
|
||||
{ "@testing/foo", &kNS_NONEXISTENT_CID },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module kTestModule = {
|
||||
mozilla::Module::kVersion,
|
||||
kTestCIDs,
|
||||
kTestContractIDs
|
||||
};
|
||||
|
||||
NSMODULE_DEFN(dummy) = &kTestModule;
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# 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/xpcom/tests/unit'
|
||||
EXTRA_PP_COMPONENTS += [
|
||||
'testcomponent.manifest',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'TestComponent.cpp',
|
||||
]
|
||||
|
||||
XPCOMBinaryComponent('testcomponent')
|
||||
|
||||
DEFINES['LIBRARY_FILENAME'] = '%s%s%s' % (
|
||||
CONFIG['DLL_PREFIX'],
|
||||
LIBRARY_NAME,
|
||||
CONFIG['DLL_SUFFIX']
|
||||
)
|
||||
|
||||
# Need to link with CoreFoundation on Mac
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
OS_LIBS += CONFIG['TK_LIBS']
|
|
@ -0,0 +1,4 @@
|
|||
#filter substitution
|
||||
binary-component @LIBRARY_FILENAME@
|
||||
binary-component @LIBRARY_FILENAME@
|
||||
binary-component @LIBRARY_FILENAME@
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# 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/.
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
LDFLAGS := $(filter-out -DYNAMICBASE,$(LDFLAGS)) -DYNAMICBASE:NO
|
|
@ -0,0 +1,33 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
|
||||
#define NS_TESTING_CID \
|
||||
{ 0x335fb596, 0xe52d, 0x418f, \
|
||||
{ 0xb0, 0x1c, 0x1b, 0xf1, 0x6c, 0xe5, 0xe7, 0xe4 } }
|
||||
|
||||
NS_DEFINE_NAMED_CID(NS_TESTING_CID);
|
||||
|
||||
static nsresult
|
||||
DummyConstructorFunc(nsISupports* aOuter, const nsIID& aIID, void** aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static const mozilla::Module::CIDEntry kTestCIDs[] = {
|
||||
{ &kNS_TESTING_CID, false, nullptr, DummyConstructorFunc },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module kTestModule = {
|
||||
mozilla::Module::kVersion,
|
||||
kTestCIDs
|
||||
};
|
||||
|
||||
NSMODULE_DEFN(dummy) = &kTestModule;
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# 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/xpcom/tests/unit'
|
||||
EXTRA_PP_COMPONENTS += [
|
||||
'testcompnoaslr.manifest',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'TestComponent.cpp',
|
||||
]
|
||||
|
||||
XPCOMBinaryComponent('testcompnoaslr')
|
||||
|
||||
DEFINES['LIBRARY_FILENAME'] = '%s%s%s' % (
|
||||
CONFIG['DLL_PREFIX'],
|
||||
LIBRARY_NAME,
|
||||
CONFIG['DLL_SUFFIX']
|
||||
)
|
||||
|
||||
# Need to link with CoreFoundation on Mac
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
OS_LIBS += CONFIG['TK_LIBS']
|
|
@ -0,0 +1,2 @@
|
|||
#filter substitution
|
||||
binary-component @LIBRARY_FILENAME@
|
|
@ -5,6 +5,9 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
TEST_DIRS += [
|
||||
'component',
|
||||
'bug656331_component',
|
||||
'component_no_aslr',
|
||||
'gtest',
|
||||
]
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
function run_test() {
|
||||
let manifest = do_get_file('components/testcompnoaslr.manifest');
|
||||
registerAppManifest(manifest);
|
||||
var sysInfo = Cc["@mozilla.org/system-info;1"].
|
||||
getService(Ci.nsIPropertyBag2);
|
||||
var ver = parseFloat(sysInfo.getProperty("version"));
|
||||
if (ver < 6.0) {
|
||||
// This is disabled on pre-Vista OSs.
|
||||
do_check_true("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
|
||||
} else {
|
||||
do_check_false("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
function info(s) {
|
||||
dump("TEST-INFO | test_compmgr_warnings.js | " + s + "\n");
|
||||
}
|
||||
|
||||
var gMessagesExpected = [
|
||||
{ line: 2, message: /Malformed CID/, found: false },
|
||||
{ line: 6, message: /re-register/, found: false },
|
||||
{ line: 9, message: /Could not/, found: false },
|
||||
{ line: 2, message: /binary component twice/, found: false },
|
||||
{ line: 3, message: /binary component twice/, found: false },
|
||||
];
|
||||
|
||||
const kConsoleListener = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIConsoleListener]),
|
||||
|
||||
observe: function listener_observe(message) {
|
||||
if (!(message instanceof Ci.nsIScriptError)) {
|
||||
info("Not a script error: " + message.message);
|
||||
return;
|
||||
}
|
||||
|
||||
info("Script error... " + message.sourceName + ":" + message.lineNumber + ": " + message.errorMessage);
|
||||
for (let expected of gMessagesExpected) {
|
||||
if (message.lineNumber != expected.line)
|
||||
continue;
|
||||
|
||||
if (!expected.message.test(message.errorMessage))
|
||||
continue;
|
||||
|
||||
info("Found expected message: " + expected.message);
|
||||
do_check_false(expected.found);
|
||||
|
||||
expected.found = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function run_deferred_event(fn) {
|
||||
do_test_pending();
|
||||
Components.classes["@mozilla.org/thread-manager;1"].
|
||||
getService(Ci.nsIThreadManager).mainThread.dispatch(function() {
|
||||
fn();
|
||||
do_test_finished();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function run_test()
|
||||
{
|
||||
let cs = Components.classes["@mozilla.org/consoleservice;1"].
|
||||
getService(Ci.nsIConsoleService);
|
||||
cs.registerListener(kConsoleListener);
|
||||
|
||||
var manifest = do_get_file('compmgr_warnings.manifest');
|
||||
registerAppManifest(manifest);
|
||||
manifest = do_get_file('components/testcomponent.manifest');
|
||||
registerAppManifest(manifest);
|
||||
|
||||
run_deferred_event(function() {
|
||||
cs.unregisterListener(kConsoleListener);
|
||||
|
||||
for (let expected of gMessagesExpected) {
|
||||
info("checking " + expected.message);
|
||||
do_check_true(expected.found);
|
||||
}
|
||||
});
|
||||
}
|
|
@ -22,8 +22,14 @@ skip-if = os == "android"
|
|||
# Bug 676998: test fails consistently on Android
|
||||
fail-if = os == "android"
|
||||
[test_bug478086.js]
|
||||
[test_bug656331.js]
|
||||
# Bug 676998: test fails consistently on Android
|
||||
fail-if = os == "android"
|
||||
[test_bug725015.js]
|
||||
[test_debugger_malloc_size_of.js]
|
||||
[test_compmgr_warnings.js]
|
||||
# Bug 676998: test fails consistently on Android
|
||||
fail-if = os == "android"
|
||||
[test_file_createUnique.js]
|
||||
[test_file_equality.js]
|
||||
[test_hidden_files.js]
|
||||
|
@ -57,6 +63,8 @@ fail-if = os == "android"
|
|||
# Bug 902081: test fails consistently on Android 2.2, passes on 4.0
|
||||
skip-if = os == "android"
|
||||
[test_versioncomparator.js]
|
||||
[test_comp_no_aslr.js]
|
||||
skip-if = os != "win"
|
||||
[test_windows_shortcut.js]
|
||||
skip-if = os != "win"
|
||||
[test_windows_cmdline_file.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче