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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/modify_move/move_around_image.html

Issue 2446893006: Convert editing/selection/4932260-[123].html to utilize w3c test harness (Closed)
Patch Set: 2016-10-28T12:57:04 Created 4 years, 2 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
Index: third_party/WebKit/LayoutTests/editing/selection/modify_move/move_around_image.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/modify_move/move_around_image.html b/third_party/WebKit/LayoutTests/editing/selection/modify_move/move_around_image.html
new file mode 100644
index 0000000000000000000000000000000000000000..42336ea5f92c29bb3e3868aba10fe0c0c07123b1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/modify_move/move_around_image.html
@@ -0,0 +1,71 @@
+<!doctype html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../assert_selection.js"></script>
+<script>
+const isMac = navigator.platform.indexOf('Mac') === 0;
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '|foo <img src="../../resources/abe.png"> bar',
+ '</div>',
+ ].join(''),
+ selection => selection.modify('move', 'forward', 'sentence'),
+ [
+ '<div contenteditable>',
+ 'foo <img src="../../resources/abe.png"> bar|',
+ '</div>',
+ ].join('')),
+ 'Move forward sentence');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ 'foo <img src="../../resources/abe.png"> bar|',
+ '</div>',
+ ].join(''),
+ selection => selection.modify('move', 'backward', 'sentence'),
+ [
+ '<div contenteditable>',
+ '|foo <img src="../../resources/abe.png"> bar',
+ '</div>',
+ ].join('')),
+ 'Move backward sentence');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '|foo<img src="../../resources/abe.png">bar baz',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.modify('move', 'forward', 'word');
+ selection.modify('move', 'forward', 'word');
+ },
+ [
+ '<div contenteditable>',
+ isMac
+ ? 'foo<img src="../../resources/abe.png">bar| baz'
+ : 'foo<img src="../../resources/abe.png">bar |baz',
+ '</div>',
+ ].join('')),
+ 'Move forward word');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ 'foo bar<img src="../../resources/abe.png">baz|',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.modify('move', 'backward', 'word');
+ selection.modify('move', 'backward', 'word');
+ },
+ [
+ '<div contenteditable>',
+ 'foo |bar<img src="../../resources/abe.png">baz',
+ '</div>',
+ ].join('')),
+ 'Move backward word');
+</script>

Powered by Google App Engine
This is Rietveld 408576698