Bug 1583496 create a subtest name on success to match the subtest for unhandled exception r=jgraham

This is part of an attempt to make subtest names independent of the performance of the test.

Depends on D47024

Differential Revision: https://phabricator.services.mozilla.com/D47025

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-10-28 09:33:55 +00:00
Родитель dddda2631a
Коммит cddf5bc5cb
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -51,6 +51,12 @@ window.Audit = (function() {
}, message);
}
function _logException(message, exception) {
test(function() {
throw exception;
}, message);
}
function _throwException(message) {
throw new Error(message);
}
@ -1191,11 +1197,12 @@ window.Audit = (function() {
// that wheel, but since it's been reinvented... At least make sure that
// an exception while running a task doesn't preclude us running all the
// _other_ tasks for the test.
let testName = `Executing "${this.label}"`;
try {
this._taskFunction(this, this.should.bind(this));
_logPassed(testName);
} catch (e) {
// Log the failure.
test(() => { throw e; }, `Executing "${this.label}"`);
_logException(testName, e);
if (this.state != TaskState.FINISHED) {
// We threw before calling done(), so do that manually to run our
// other tasks.