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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/typing-around-image-001.html

Issue 2291973002: Convert editing/inserting/typing-around-image-001.html to use w3c test harness (Closed)
Patch Set: 2016-08-30T15:58:33 Created 4 years, 4 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-around-image-001-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-around-image-001.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/typing-around-image-001.html b/third_party/WebKit/LayoutTests/editing/inserting/typing-around-image-001.html
index 4236efeb7f1ca4b708926a46d6e64cb61a6df8be..1d995123d96c3489d00544d5d6b98ae7fcf597a4 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/typing-around-image-001.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/typing-around-image-001.html
@@ -1,46 +1,35 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: 2px solid red;
- padding: 12px;
- font-size: 24px;
-}
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-function moveNSpacesAndType(n) {
- for (i = 0; i < n; i++) {
- moveSelectionForwardByCharacterCommand();
- }
- for (i = 0; i < 3; i++) {
- typeCharacterCommand();
- }
-}
-
-function editingTest() {
- typeCharacterCommand();
- moveNSpacesAndType(1);
- moveNSpacesAndType(1);
- moveNSpacesAndType(1);
- moveNSpacesAndType(1);
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
-<body>
-<div contenteditable id="root" class="editing">
-<span id="test"><img src="../resources/abe.png"><img src="../resources/abe.png"> <img src="../resources/abe.png"></span>
-</div>
-
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-runEditingTest();
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '|<img src="../resources/abe.png">',
+ '<img src="../resources/abe.png">',
+ ' <img src="../resources/abe.png">',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('insertText', false, 'a');
+ selection.modify('move', 'forward', 'character');
+ selection.document.execCommand('insertText', false, 'bcd');
+ selection.modify('move', 'forward', 'character');
+ selection.document.execCommand('insertText', false, 'efg');
+ selection.modify('move', 'forward', 'character');
+ selection.document.execCommand('insertText', false, 'hij');
+ selection.modify('move', 'forward', 'character');
+ selection.document.execCommand('insertText', false, 'klm');
+
+ },
+ [
+ '<div contenteditable>',
+ 'a<img src="../resources/abe.png">',
+ 'bcd<img src="../resources/abe.png">',
+ 'efg\u{00A0}hij<img src="../resources/abe.png">',
+ 'klm|',
+ '</div>',
+ ].join('')),
+ 'insertText around image');
</script>
-
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/typing-around-image-001-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698