Bug 1514158 - Simplify exception asserts in test_mr_state_transition.html. r=bryce

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-10-03 22:09:09 +00:00
Родитель 7dd1457975
Коммит e7ff4e1d3b
1 изменённых файлов: 5 добавлений и 8 удалений

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

@ -237,16 +237,13 @@ function runStateTransitionTests(testStream) {
}
}
if (operationTest.isValid) {
ok(true, 'Successful transitions for ' + operationsString);
} else {
ok(false, 'Failed transitions for ' + operationsString);
}
ok(operationTest.isValid, `${operationsString} should succeed`);
} catch (err) {
if (!operationTest.isValid && err.name === 'InvalidStateError') {
ok(true, 'InvalidStateError fired for ' + operationsString);
if (operationTest.isValid) {
ok(false, `${operationsString} failed unexpectedly with ${err.name}`);
} else {
ok(false, 'No InvalidStateError for ' + operationsString);
is(err.name, "InvalidStateError",
`${operationsString} expected to fail with InvalidStateError`);
}
}
}