Commit c3adf63f authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

Split skip-not-fully-active.html into two tests

We'd like to prioritize loading and compositing tasks till FCP and this
appears to expose a problem with the test. The timing of the script on
line 6 with respect to the second promise test is a bit fragile.

If the iframe script runs before the promise then
document.querySelector('iframe') returns null and the test fails.

This timing issue seems unrelated to the test itself, so I propose
splitting the test into two as the simplest fix.

Bug: 971191
Change-Id: I65384093ac8f4616d64fc21ee692d145be1655a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807323Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697512}
parent b487e622
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/utils.js"></script>
<script>
'use strict';
promise_test(async () => {
let doc = document.cloneNode(false);
doc.appendChild(doc.createElement('html'))
doc.firstChild.innerHTML = '<body><input autofocus/></body>';
await waitUntilStableAutofocusState();
assert_equals(doc.activeElement, doc.body);
}, 'Autofocus element in not-fully-active document should not be queued.');
</script>
......@@ -8,14 +8,6 @@
<script>
'use strict';
promise_test(async () => {
let doc = document.cloneNode(false);
doc.appendChild(doc.createElement('html'))
doc.firstChild.innerHTML = '<body><input autofocus/></body>';
await waitUntilStableAutofocusState();
assert_equals(doc.activeElement, doc.body);
}, 'Autofocus element in not-fully-active document should not be queued.');
promise_test(async () => {
let iframe = document.querySelector('iframe');
let iframeDocument = iframe.contentDocument;
......
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