Bug 1550370 [wpt PR 16676] - Fix the exception-handling for resize-observer., a=testonly

Automatic update from web-platform-tests
Fix the exception-handling for resize-observer. (#16676)

The current test framework of resize-observer will get timeout if any of the
`assert_equals` is failed. It's not good and pretty hard to debug.
A possible way to sub-optimize it is throw the error in the step function
(so we can catch the failure message) and keep running the next test cases
without triggering any timeout.
--

wpt-commits: 3a25aa05f678277b0606842b44c5b4b1ab28c481
wpt-pr: 16676
This commit is contained in:
Boris 2019-05-20 15:03:37 +00:00 committed by James Graham
parent f498b87768
commit 852c549e4e

View File

@ -80,11 +80,20 @@ ResizeTestHelper.prototype = {
delete this._timeoutId;
}
this._harnessTest.step(() => {
let rafDelay = this._currentStep.notify(entries, this._observer);
if (rafDelay)
window.requestAnimationFrame(this._nextStepBind);
else
this._nextStep();
try {
let rafDelay = this._currentStep.notify(entries, this._observer);
if (rafDelay)
window.requestAnimationFrame(this._nextStepBind);
else
this._nextStep();
}
catch(err) {
this._harnessTest.step(() => {
throw err;
});
// Force to _done() the current test.
this._done();
}
});
},