| Index: third_party/WebKit/LayoutTests/fast/dom/focus-navigation-in-plugin.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/focus-navigation-in-plugin.html b/third_party/WebKit/LayoutTests/fast/dom/focus-navigation-in-plugin.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2512dcb5f4b8844c4e9c2702754cbc768155fd6a
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/focus-navigation-in-plugin.html
|
| @@ -0,0 +1,47 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<input id="outer-before">
|
| +<object data="resources/plugin-focus-subframe.html" type="text/html" id="obj"></object>
|
| +<embed src="resources/plugin-focus-subframe.html" type="text/html" id="emb"></embed>
|
| +<input id="outer-after">
|
| +<script>
|
| +function PressTab() {
|
| + eventSender.keyDown('\t');
|
| +}
|
| +
|
| +function PressShiftTab() {
|
| + eventSender.keyDown('\t', ['shiftKey']);
|
| +}
|
| +
|
| +function testFocusNavigation() {
|
| + test(() => {
|
| + var before = document.querySelector('#outer-before');
|
| + var after = document.querySelector('#outer-after');
|
| +
|
| + before.focus();
|
| +
|
| + // 'plugin-focus-subframe.html' has 2 focus areas.
|
| + var expected = ['outer-before', 'obj', 'obj', 'emb', 'emb', 'outer-after'];
|
| +
|
| + var i;
|
| + for (i = 0; i < 5; ++i) {
|
| + assert_equals(document.activeElement.id, expected[i]);
|
| + PressTab();
|
| + }
|
| + assert_equals(document.activeElement, after, '#after');
|
| +
|
| + expected.reverse();
|
| + for (i = 0; i < 5; ++i) {
|
| + assert_equals(document.activeElement.id, expected[i]);
|
| + PressShiftTab();
|
| + }
|
| + assert_equals(document.activeElement, before, '#before');
|
| +
|
| + }, "Focus should navigate to <option>/<embed>");
|
| +}
|
| +
|
| +if (window.testRunner) {
|
| + window.addEventListener('load', testFocusNavigation, false);
|
| +}
|
| +</script>
|
|
|