Automatic update from web-platform-tests HTML: remove flakiness from focus test Depending on whether an <object> element is showing anything it might be focusable or not. -- Update chrome-object-tab-focus-bug.html -- wpt-commits: 61076154295bc319f2e96111c21f86439cc0682c, 5a79d5ee6258db4f005795803d8008d19ffee7e5 wpt-pr: 58384
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>Tabbing through object tag</title>
|
|
<link rel="author" title="atotic@chromium.org">
|
|
<link rel="help" href="https://crbug.com/1132895">
|
|
<meta assert="assert" content="Tabbed focus works through OBJECT tags">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/testdriver.js"></script>
|
|
<script src="/resources/testdriver-vendor.js"></script>
|
|
|
|
<p>Pressing TAB twice should focus end text box</p>
|
|
|
|
<input type="checkbox" id="start">start</a>
|
|
<object type='text/html' data='data:text/html,' width='16' height='16'></object>
|
|
<input id="end">end</a>
|
|
|
|
<script>
|
|
|
|
let t = async_test("focus advances with tab key thorough object element");
|
|
|
|
let start = document.querySelector("#start");
|
|
let object = document.querySelector("object");
|
|
let end = document.querySelector("#end");
|
|
let tab = "\uE004";
|
|
|
|
addEventListener("load", t.step_func(_ => {
|
|
start.focus();
|
|
assert_equals(document.activeElement, start, "start got focus");
|
|
test_driver.send_keys(document.activeElement, tab).then(t.step_func(_ => {
|
|
assert_equals(document.activeElement, object, "object got focus");
|
|
test_driver.send_keys(document.activeElement, tab).then(t.step_func_done(_ => {
|
|
assert_equals(document.activeElement, end, "end got focus");
|
|
}));
|
|
}));
|
|
}));
|
|
|
|
</script>
|