diff options
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/notify-event-iframe.https.html')
-rw-r--r-- | testing/web-platform/tests/fenced-frame/notify-event-iframe.https.html | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/testing/web-platform/tests/fenced-frame/notify-event-iframe.https.html b/testing/web-platform/tests/fenced-frame/notify-event-iframe.https.html index 854db2f303..1f8e1b8a32 100644 --- a/testing/web-platform/tests/fenced-frame/notify-event-iframe.https.html +++ b/testing/web-platform/tests/fenced-frame/notify-event-iframe.https.html @@ -1,4 +1,5 @@ <!DOCTYPE html> +<meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/testdriver.js"></script> @@ -20,8 +21,10 @@ fencedframe.element.addEventListener('fencedtreeclick', () => notified = true); await fencedframe.execute(async (frame_type) => { - window.addEventListener('message', (event) => { - window.click_error = event.data; + window.click_error = new Promise((resolve, reject) => { + window.addEventListener('message', (event) => { + resolve(event.data); + }); }); let iframe = null; @@ -53,9 +56,10 @@ await multiClick(10, 10, fencedframe.element); // Ensure the correct exception was thrown. - await fencedframe.execute(() => { - assert_equals(window.click_error.name, 'SecurityError'); - assert_equals(window.click_error.message, + await fencedframe.execute(async () => { + let err = await window.click_error; + assert_equals(err.name, 'SecurityError'); + assert_equals(err.message, "Failed to execute 'notifyEvent' on 'Fence': notifyEvent is only available in fenced frame roots."); }); @@ -73,8 +77,10 @@ }, "Test that fenced frame notifyEvent() fails in a nested cross-origin iframe."); promise_test(async (t) => { - window.addEventListener('message', (event) => { - window.click_error = event.data; + window.click_error = new Promise((resolve, reject) => { + window.addEventListener('message', (event) => { + resolve(event.data); + }); }); const urn_iframe = await attachIFrameContext( @@ -94,8 +100,9 @@ await multiClick(10, 10, urn_iframe.element); - assert_equals(window.click_error.name, 'SecurityError'); - assert_equals(window.click_error.message, + let err = await window.click_error + assert_equals(err.name, 'SecurityError'); + assert_equals(err.message, "Failed to execute 'notifyEvent' on 'Fence': notifyEvent is only available in fenced frame roots."); }, "Test that notifyEvent() fails in a URN iframe."); </script> |