Bug 1775499 - update user_timing_dying_global test for performance.measure. r=sefeng

Root cause of test failure: the updates in this bug caused performance.measure
to throw an exception if there is a dying global. However, the test didn't try
to catch the exception so it failed with an uncaught exception. I updated the
test to handle this case which it was already doing for performance.mark.

Additionally, I corrected some indentation.

Depends on D151960

Differential Revision: https://phabricator.services.mozilla.com/D152814
This commit is contained in:
Michael Comella 2022-07-27 18:17:17 +00:00
parent bd58669a22
commit 90e0d5b6e0

View File

@ -40,13 +40,17 @@
ok(true, 'new PerformanceMark() on dying global did not crash'); ok(true, 'new PerformanceMark() on dying global did not crash');
try { try {
dyingWindow.performance.mark('markMethod', {detail: 'markMethodDetail'}); dyingWindow.performance.mark('markMethod', {detail: 'markMethodDetail'});
} catch (e) { } catch (e) {
is(e.code, e.INVALID_STATE_ERR, 'performance.mark on dying global threw expected exception'); is(e.code, e.INVALID_STATE_ERR, 'performance.mark on dying global threw expected exception');
} }
ok(true, 'performance.mark on dying global did not crash'); ok(true, 'performance.mark on dying global did not crash');
dyingWindow.performance.measure('measureMethod'); try {
dyingWindow.performance.measure('measureMethod');
} catch (e) {
is(e.code, e.INVALID_STATE_ERR, 'performance.measure on dying global threw expected exception');
}
ok(true, 'performance.measure on dying global did not crash'); ok(true, 'performance.measure on dying global did not crash');
} }
</script> </script>