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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/arrow_key_with_unfocused_selection.html

Issue 2886933002: Make EnabledInEditableText return false for user-triggered command and unfocused selection (Closed)
Patch Set: Created 3 years, 7 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/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/selection/arrow_key_with_unfocused_selection.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/arrow_key_with_unfocused_selection.html b/third_party/WebKit/LayoutTests/editing/selection/arrow_key_with_unfocused_selection.html
new file mode 100644
index 0000000000000000000000000000000000000000..ee071d66c81468e5f3bced67e67a3b1328aebacc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/arrow_key_with_unfocused_selection.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+// Regression tests for crbug.com/713607.
+
+test(() => {
+ assert_exists(window, 'eventSender', 'This test requires eventSender');
+
+ assert_selection(
+ [
+ '<textarea>^text|</textarea>',
+ '<a href="http://www.example.com/">link</a>'
+ ].join(''),
+ selection => {
+ const link = selection.document.querySelector('a');
+ link.focus();
+ eventSender.keyDown('ArrowLeft');
+ assert_equals(selection.document.activeElement, link);
+ },
+ [
+ '|<textarea>text</textarea>',
+ '<a href="http://www.example.com/">link</a>'
+ ].join(''));
+}, 'Press left arrow key with unfocused selection in text control');
+
+test(() => {
+ assert_exists(window, 'eventSender', 'This test requires eventSender');
+
+ assert_selection(
+ [
+ '<div contenteditable>^text|</div>',
+ '<a href="http://www.example.com/">link</a>'
+ ].join(''),
+ selection => {
+ const link = selection.document.querySelector('a');
+ link.focus();
+ eventSender.keyDown('ArrowLeft');
+ assert_equals(selection.document.activeElement, link);
+ },
+ [
+ '<div contenteditable>^text|</div>',
+ '<a href="http://www.example.com/">link</a>'
+ ].join(''));
+}, 'Press left arrow key with unfocused selection in contenteditable div');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698