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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001.html

Issue 2288703002: Convert editing/inserting/insert-thai-characters-001.html to use w3c test harness (Closed)
Patch Set: 2016-08-29T18:09:14 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/editing/inserting/insert-thai-characters-001-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001.html
index 2b4147af6d5457940f3778682c153d465e0d22ab..79cfcc1f0304cad45a81c9a2df678988b62cbad7 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001.html
@@ -1,50 +1,29 @@
-<html>
-<head>
-<title>Editing Test (Inserting a Thai character after a Thai prepend character)</title>
-<script src="../editing.js" language="javascript" type="text/javascript"></script>
-<script language="javascript" type="text/javascript">
-function log(str) {
- var li = document.createElement("li");
- li.appendChild(document.createTextNode(str));
- var console = document.getElementById("console");
- console.appendChild(li);
-}
-function editingTest() {
- if (window.testRunner)
- testRunner.dumpAsText();
- var testarea = document.getElementById("test");
- testarea.focus();
- typeCharacterCommand(String.fromCharCode(0x0E2D));
- typeCharacterCommand(String.fromCharCode(0x0E22));
- typeCharacterCommand(String.fromCharCode(0x0E32));
- typeCharacterCommand(String.fromCharCode(0x0E01));
- typeCharacterCommand(String.fromCharCode(0x0E0D));
- typeCharacterCommand(String.fromCharCode(0x0E35));
- typeCharacterCommand(String.fromCharCode(0x0E48));
- typeCharacterCommand(String.fromCharCode(0x0E1B));
- typeCharacterCommand(String.fromCharCode(0x0E38));
- typeCharacterCommand(String.fromCharCode(0x0E48));
- typeCharacterCommand(String.fromCharCode(0x0E19));
- moveSelectionBackwardByCharacterCommand();
- moveSelectionBackwardByCharacterCommand();
- moveSelectionBackwardByCharacterCommand();
- typeCharacterCommand(String.fromCharCode(0x0E44));
- typeCharacterCommand(String.fromCharCode(0x0E1B));
- var expected_result = "\u0E2D\u0E22\u0E32\u0E01\u0E44\u0E1B\u0E0D\u0E35\u0E48\u0E1B\u0E38\u0E48\u0E19";
- if (testarea.textContent == expected_result)
- log("Succeeded.");
- else
- log("Failed. Actual: \"" + testarea.textContent.value + "\", Expected: \"" + expected_result + "\".");
-}
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<div id="log"></div>
+<script>
+test(() => assert_selection(
+ '<div contenteditable>|</div>',
+ selection => {
+ selection.document.execCommand('insertText', false, '\u0E2D');
+ selection.document.execCommand('insertText', false, '\u0E22');
+ selection.document.execCommand('insertText', false, '\u0E32');
+ selection.document.execCommand('insertText', false, '\u0E01');
+ selection.document.execCommand('insertText', false, '\u0E0D');
+ selection.document.execCommand('insertText', false, '\u0E35');
+ selection.document.execCommand('insertText', false, '\u0E48');
+ selection.document.execCommand('insertText', false, '\u0E1B');
+ selection.document.execCommand('insertText', false, '\u0E38');
+ selection.document.execCommand('insertText', false, '\u0E48');
+ selection.document.execCommand('insertText', false, '\u0E19');
+ selection.modify('move', 'backward', 'character');
+ selection.modify('move', 'backward', 'character');
+ selection.modify('move', 'backward', 'character');
+ selection.document.execCommand('insertText', false, '\u0E44');
+ selection.document.execCommand('insertText', false, '\u0E1B');
+ },
+ '<div contenteditable>\u0E2D\u0E22\u0E32\u0E01\u0E44\u0E1B|\u0E0D\u0E35\u0E48\u0E1B\u0E38\u0E48\u0E19</div>'),
+ 'insert a Thai character after a Thai "prepend" character');
</script>
-</head>
-<body>
-<p>This test tests whether we can insert a Thai character after a Thai "prepend" character.</p>
-<p>If this test succeeds, you can see a string "succeeded" below.</p>
-<div contenteditable id="test"></div>
-<ul id="console"></ul>
-<script language="javascript" type="text/javascript">
-runEditingTest();
-</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/inserting/insert-thai-characters-001-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698