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

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

Issue 2184603002: Convert editing/typing-around-br-001.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-26T14:59:23 Created 4 years, 5 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-br-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-br-001.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/typing-around-br-001.html b/third_party/WebKit/LayoutTests/editing/inserting/typing-around-br-001.html
index bba7f54f7e4358fe4b8381ea7ef45f881d200b8a..3515986d390e28168595868639ea49c6f32d1fb3 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/typing-around-br-001.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/typing-around-br-001.html
@@ -1,49 +1,34 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: 2px solid red;
- padding: 12px;
- font-size: 24px;
-}
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-
-function moveNSpacesAndType(n) {
- for (i = 0; i < n; i++) {
- moveSelectionForwardByCharacterCommand();
- }
- for (i = 0; i < 3; i++) {
- typeCharacterCommand();
- }
-}
-
-function editingTest() {
- moveNSpacesAndType(2);
- moveNSpacesAndType(3);
- moveNSpacesAndType(1);
- moveNSpacesAndType(3);
- moveNSpacesAndType(1);
- moveNSpacesAndType(1);
- moveNSpacesAndType(1);
- moveNSpacesAndType(3);
-}
-
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<span>|XX<br>XX<br><br>XX<br><br><br><br>XX</span>',
+ '</div>',
+ ].join(''),
+ selection => {
+ function moveNSpacesAndType(n) {
+ for (var i = 0; i < n; ++i)
+ selection.modify('move', 'forward', 'character');
+ for (var i = 0; i < 3; ++i)
+ selection.document.execCommand('insertText', false, 'a');
+ }
+ moveNSpacesAndType(2);
+ moveNSpacesAndType(3);
+ moveNSpacesAndType(1);
+ moveNSpacesAndType(3);
+ moveNSpacesAndType(1);
+ moveNSpacesAndType(1);
+ moveNSpacesAndType(1);
+ moveNSpacesAndType(3);
+ },
+ [
+ '<div contenteditable>',
+ '<span>XXaaa<br>XXaaa<br>aaa<br>XXaaa<br>aaa<br>aaa<br>aaa<br>XXaaa|</span>',
+ '</div>',
+ ].join('')),
+ 'Typing around BR');
</script>
-
-<title>Editing Test</title>
-</head>
-<body>
-<div contenteditable id="root" class="editing">
-<span id="test">XX<br>XX<br><br>XX<br><br><br><br>XX</span>
-</div>
-
-<script>
-runEditingTest();
-</script>
-
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/typing-around-br-001-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698