From 90e0d5b6e09da6a92dbe03431eaaa00f42a52af6 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 27 Jul 2022 18:17:17 +0000 Subject: [PATCH] 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 --- .../test_performance_user_timing_dying_global.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dom/performance/tests/test_performance_user_timing_dying_global.html b/dom/performance/tests/test_performance_user_timing_dying_global.html index 74a16fa995a7..18e4a54684d6 100644 --- a/dom/performance/tests/test_performance_user_timing_dying_global.html +++ b/dom/performance/tests/test_performance_user_timing_dying_global.html @@ -40,13 +40,17 @@ ok(true, 'new PerformanceMark() on dying global did not crash'); try { - dyingWindow.performance.mark('markMethod', {detail: 'markMethodDetail'}); + dyingWindow.performance.mark('markMethod', {detail: 'markMethodDetail'}); } 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'); - 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'); }