mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1339404 - Remove testPassesUnlessItThrows and setRestoreFunction from jstest harness. r=arai
--HG-- extra : rebase_source : d12230195d430e1f7e6d57c6fcb701767a4b64f8
This commit is contained in:
parent
fbb59a7460
commit
09eeed665b
@ -309,41 +309,13 @@ var gPageCompleted;
|
||||
var GLOBAL = this + '';
|
||||
|
||||
// Variables local to jstests harness.
|
||||
var jstestsTestPassesUnlessItThrows = false;
|
||||
var jstestsRestoreFunction;
|
||||
var jstestsOptions;
|
||||
|
||||
/*
|
||||
* Signals to this script that the current test case should be considered to
|
||||
* have passed if it doesn't throw an exception.
|
||||
*
|
||||
* Overrides the same-named function in shell.js.
|
||||
*/
|
||||
function testPassesUnlessItThrows() {
|
||||
jstestsTestPassesUnlessItThrows = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets a restore function which restores the standard built-in ECMAScript
|
||||
* properties after a destructive test case, and which will be called after
|
||||
* the test case terminates.
|
||||
*/
|
||||
function setRestoreFunction(restore) {
|
||||
jstestsRestoreFunction = restore;
|
||||
}
|
||||
|
||||
window.onerror = function (msg, page, line)
|
||||
{
|
||||
jstestsTestPassesUnlessItThrows = false;
|
||||
|
||||
// Restore options in case a test case used this common variable name.
|
||||
options = jstestsOptions;
|
||||
|
||||
// Restore the ECMAScript environment after potentially destructive tests.
|
||||
if (typeof jstestsRestoreFunction === "function") {
|
||||
jstestsRestoreFunction();
|
||||
}
|
||||
|
||||
optionsPush();
|
||||
|
||||
if (typeof DESCRIPTION == 'undefined')
|
||||
@ -632,17 +604,6 @@ function jsTestDriverEnd()
|
||||
// Restore options in case a test case used this common variable name.
|
||||
options = jstestsOptions;
|
||||
|
||||
// Restore the ECMAScript environment after potentially destructive tests.
|
||||
if (typeof jstestsRestoreFunction === "function") {
|
||||
jstestsRestoreFunction();
|
||||
}
|
||||
|
||||
if (jstestsTestPassesUnlessItThrows) {
|
||||
var testcase = new TestCase("unknown-test-name", "", true, true);
|
||||
print(PASSED);
|
||||
jstestsTestPassesUnlessItThrows = false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
optionsReset();
|
||||
|
@ -436,20 +436,6 @@
|
||||
};
|
||||
global.writeFormattedResult = writeFormattedResult;
|
||||
|
||||
/*
|
||||
* Signals to results.py that the current test case should be considered to
|
||||
* have passed if it doesn't throw an exception.
|
||||
*
|
||||
* When the test suite is run in the browser, this function gets overridden by
|
||||
* the same-named function in browser.js.
|
||||
*/
|
||||
// Note: browser.js overrides this function.
|
||||
// XXX: Remove this function - it's no longer used.
|
||||
function testPassesUnlessItThrows() {
|
||||
print(PASSED);
|
||||
}
|
||||
global.testPassesUnlessItThrows = testPassesUnlessItThrows;
|
||||
|
||||
/*
|
||||
* wrapper for test case constructor that doesn't require the SECTION
|
||||
* argument.
|
||||
|
Loading…
Reference in New Issue
Block a user