Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/focus-navigation-in-plugin.html

Issue 2129863002: Handle focusability for plugin elements which has browsing context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use super class. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/plugin-focus-subframe.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/plugin-focus-subframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698