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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/typing-at-end-of-line.html

Issue 2937863002: Rewrite editing/inserting/typing-at-end-of-line.html to utilize assert_selection() (Closed)
Patch Set: 2017-06-14T12:50:16 Created 3 years, 6 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/platform/linux/editing/inserting/typing-at-end-of-line-expected.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/inserting/typing-at-end-of-line.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/typing-at-end-of-line.html b/third_party/WebKit/LayoutTests/editing/inserting/typing-at-end-of-line.html
index 419b9dae79e607370bcca110adafbe5f0796d117..9ff2e104ef10a05755f1b414c4df42d46875ec85 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/typing-at-end-of-line.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/typing-at-end-of-line.html
@@ -1,19 +1,24 @@
-<html>
-<head>
-<title>Text does not split on white space when typing to the edge of window</title>
-</head>
-<body style="overflow:hidden;">
-<div>This test validates the fix for a bug that occurred when typing a blank at the end of a line when the character doesn't fix by a fraction of a pixel. If the test runs correctly, you should see the word 'you' at the end of the line and the word 'have' at the beginning of the following line.</div>
-<br>
-<div id="test" contenteditable style="font: 12px 'lucida grande'; outline: solid blue; width: 871px; height: 100px;">
-and Anna, you can do your regular weekly report run, and I'll extract the key sections into this. Andrew and Mark, I'd like to include any new bits you
-</div>
-</body>
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-const selection = getSelection();
-selection.collapse(document.getElementById('test'), 0);
-selection.modify('move', 'forward', 'line');
-// Inserts text at end of line.
-document.execCommand('insertText', false, ' have');
+const style='font: 12px lucida\\ grande; width: 871px; height: 100px;';
+test(() => assert_selection(
+ [
+ `<div contenteditable style="${style}">`,
+ 'and Anna, you can do your regular weekly report run, and I\'ll extract ',
+ 'the key sections into this. Andrew and Mark, I\'d like to ',
+ '|include any new bits you',
+ '</div>',
+ ].join(''),
+ selection => selection.document.execCommand('insertText', false, ' have'),
+ [
+ `<div contenteditable style="${style}">`,
+ 'and Anna, you can do your regular weekly report run, and I\'ll extract ',
+ 'the key sections into this. Andrew and Mark, I\'d like to ',
+ '\u00A0have|include any new bits you',
+ '</div>',
+ ].join('')),
+ 'Text does not split on white space when typing to the edge of window');
</script>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/typing-at-end-of-line-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698