Commit 40608b3c authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Fix interfaces/Document/getAnimations.html test

This test was assuming that the iframe load event could not fire during
appendChild, which it does on Chrome. To fix this, setup the promise
before calling appendChild, but only await on it afterwards.

Bug: None
Change-Id: Ie5ebdd7cec0fe0c276621033afaa8e8a5699dad1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1833902Reviewed-by: default avatarKevin Ellis <kevers@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702037}
parent bf0b6ce3
...@@ -4,7 +4,7 @@ PASS Test document.getAnimations for script-generated animations ...@@ -4,7 +4,7 @@ PASS Test document.getAnimations for script-generated animations
PASS Test the order of document.getAnimations with script generated animations PASS Test the order of document.getAnimations with script generated animations
PASS Test document.getAnimations for a disconnected node PASS Test document.getAnimations for a disconnected node
PASS Test document.getAnimations with null target PASS Test document.getAnimations with null target
FAIL Test document.getAnimations for elements inside same-origin iframes assert_true: Not expecting event, but got load event expected true got false FAIL Test document.getAnimations for elements inside same-origin iframes assert_equals: expected 1 but got 0
PASS Triggers a style change event PASS Triggers a style change event
Harness: the test ran to completion. Harness: the test ran to completion.
...@@ -68,11 +68,12 @@ promise_test(async t => { ...@@ -68,11 +68,12 @@ promise_test(async t => {
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');
const eventWatcher = new EventWatcher(t, iframe, ['load']); const eventWatcher = new EventWatcher(t, iframe, ['load']);
const event_promise = eventWatcher.wait_for('load');
document.body.appendChild(iframe); document.body.appendChild(iframe);
t.add_cleanup(() => { document.body.removeChild(iframe); }); t.add_cleanup(() => { document.body.removeChild(iframe); });
await eventWatcher.wait_for('load'); await event_promise;
const div = createDiv(t, iframe.contentDocument) const div = createDiv(t, iframe.contentDocument)
const effect = new KeyframeEffect(div, null, 100 * MS_PER_SEC); const effect = new KeyframeEffect(div, null, 100 * MS_PER_SEC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment