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

Unified Diff: LayoutTests/fast/plugins/plugin-placeholder-focus.html

Issue 732783002: Reland HTMLPlugInElement: Use custom focus logic only when there is a plugin. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 1 month 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 | LayoutTests/fast/plugins/plugin-placeholder-focus-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/plugins/plugin-placeholder-focus.html
diff --git a/LayoutTests/fast/plugins/plugin-placeholder-focus.html b/LayoutTests/fast/plugins/plugin-placeholder-focus.html
new file mode 100644
index 0000000000000000000000000000000000000000..fc4ce9339155a8da0347526f25049b867cbda860
--- /dev/null
+++ b/LayoutTests/fast/plugins/plugin-placeholder-focus.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<div id="description"></div>
+<div id="console"></div>
+
+<input id="input1">
+<object id="plugin1" type="application/x-fake-plugin"></object>
+
+<script>
+description('Ensures that elements within a plugin placeholder can be keyboard focused.');
+
+// Close buttons are focusable, so we expect focus to move into and out of the placeholder.
+var input1 = document.getElementById("input1");
+var plugin1 = document.getElementById("plugin1");
+internals.forcePluginPlaceholder(plugin1, { closeable: true });
+var shadowRoot1 = internals.youngestShadowRoot(plugin1);
+input1.focus();
+shouldBe("document.activeElement", "input1");
+shouldBeNull("shadowRoot1.activeElement");
+eventSender.keyDown("\t");
+shouldBe("document.activeElement", "plugin1");
+shouldBeNonNull("shadowRoot1.activeElement");
+eventSender.keyDown("\t", ["shiftKey"]);
+shouldBe("document.activeElement", "input1");
+shouldBeNull("shadowRoot1.activeElement");
+document.activeElement.blur();
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/plugins/plugin-placeholder-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698