Bug 842476: Work around leak resulting from exception that happens during unload by propagating only the prompts we expect and not the later ones.  r=jlebar

Make this test less sensitive to the timing of its own unloading by
passing on only the expected messages and not any messages that occur
during unloading.  Such messages might cause exceptions (e.g.,
"'TypeError: can't access dead object' when calling method:
[nsIPrompt::alert]"), and those exceptions might in turn trigger leaks
in nsXPConnect that last until shutdown because we store the most recent
exception from a call to an XPCWrappedJS on the XPCJSRuntime through
shutdown (rather than reporting it, as we probably should, and then
freeing it), leaking the window.
Bug 404077:  Add mochitest support (currently semi-disabled) for making tests fail when an unexpected number of assertions fire.  r=ted

This adds support for assertion checking in all mochitest suites except
for mochitest-browser-chrome.  The checking works much like it does in
reftest, except for the mechanism for annotating expected assertions,
SimpleTest.expectAssertions() (see its in-code documentation).

The support is initially disabled in that:
 (1) It doesn't cause the tests to report failure (and thus turn the
     tree orange).
 (2) It prints TEST-DETCEPXENU-FAIL/PASS instead of
     TEST-UNEXPECTED-FAIL/PASS (so that it doesn't show up in log
     highlighting).

The assertion checking only works within the test runner (which runs
multiple tests); it does not function when running only a single test.