Only the httpd.js unit tests actually rely on this. I tried to make them use Cu.import but they also rely on poking a bunch of stuff in httpd.js that's not exported, so instead I just made the test manifest copy httpd.js to the test directory and had them load it from there.
--HG--
extra : rebase_source : 24b04d619891ec95e5df23a2eb7f3277dd3206b2
extra : amend_source : 72139cecdcd695171e2fd0ce8ea7be91c1eebd1a
As referenced in Bug 982852, this fix makes run_tests() optional.
Test cases can now consist of add_test() and add_task() calls
without the need to exclusively set up a run_test() just to call
run_next_test() inside it. If run_test() however is defined, it
will be called directly as usual, which should keep all older
tests working without breaking.
Since most run_test() calls right now are mostly boilerplate and
usually are of the form -- function run_test(){run_next_test();} --
this fix checks if run_test is defined by using the typeof operator
which should evaluate to "function" if it is defined. If defined,
it is called straight away, otherwise, run_next_test() is called,
which is what run_test() usually does when used as a set up to
call tests registered by add_test() and add_task().
--HG--
extra : rebase_source : 7cfbf30a67e3a8d088f8409edcdde8976f46b941
This is for aurora (dev edition) compatibility. In this channel, there is a
selected lightweight theme by default. Tests don't expect this to be the case
so this simply resets the relevant prefs for mochitests and xpcshell tests.
The -*- file variable lines -*- establish per-file settings that Emacs will
pick up. This patch makes the following changes to those lines (and touches
nothing else):
- Never set the buffer's mode.
Years ago, Emacs did not have a good JavaScript mode, so it made sense
to use Java or C++ mode in .js files. However, Emacs has had js-mode for
years now; it's perfectly serviceable, and is available and enabled by
default in all major Emacs packagings.
Selecting a mode in the -*- file variable line -*- is almost always the
wrong thing to do anyway. It overrides Emacs's default choice, which is
(now) reasonable; and even worse, it overrides settings the user might
have made in their '.emacs' file for that file extension. It's only
useful when there's something specific about that particular file that
makes a particular mode appropriate.
- Correctly propagate settings that establish the correct indentation
level for this file: c-basic-offset and js2-basic-offset should be
js-indent-level. Whatever value they're given should be preserved;
different parts of our tree use different indentation styles.
- We don't use tabs in Mozilla JS code. Always set indent-tabs-mode: nil.
Remove tab-width: settings, at least in files that don't contain tab
characters.
- Remove js2-mode settings that belong in the user's .emacs file, like
js2-skip-preprocessor-directives.
This patch makes the crash reporter crash event directory aware and
writes main process crash event files at crash time.
--HG--
extra : rebase_source : 1d6a817ae401230b3fe8fcd236468ceb3e309a10
If an xpcshell test called run_next_test() from inside an add_task(),
bad things would happen. This patch detects that behavior and aborts the
test immediately with an actionable error message.
--HG--
extra : rebase_source : c5cf11070421b95a6fcf476d0a86289a3d0ba73a
extra : amend_source : cec6ad2a751bba01e7d4ecbff0735b39e3326efb
I looked through the NSPR socket creation functions that InitWithAddress
uses to see which errors they could return, and placed appropriate comments
in ErrorAccordingToNSPR.
The test coverage is not great; in particular, I wasn't able to find a way
to elicit "address in use" errors from Windows (although I could from
Linux); the web says that Windows is much more relaxed about binding
listening sockets than Unix derivatives. I'm interested in suggestions.