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

Unified Diff: third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html

Issue 2163163002: Convert editing/deleting/delete-ligature-003.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-20T16:37:01 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/editing/deleting/delete-ligature-003-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/deleting/delete-ligature-003.html
diff --git a/third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html b/third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html
index b4cd5ebf10e50e93280d6d6725f82236fedf15fc..c694efc9d7d5a14aca9c44a6a811234cfc76a796 100644
--- a/third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html
+++ b/third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003.html
@@ -1,50 +1,24 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <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 sendBackwardDeleteKey() {
- if (window.eventSender)
- eventSender.keyDown("Backspace", null);
- }
- function runTestOn(platform) {
- var testarea = document.getElementById("test");
- if (window.internals)
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+['mac', 'win', 'unix', 'android'].forEach(platform =>
+ test(() => {
+ assert_not_equals(window.eventSender, undefined,
+ 'This test requires window.eventSender');
+ assert_not_equals(window.internals, undefined,
+ 'This test requires window.internals');
yoichio 2016/07/21 01:49:17 You can put these asserts out of forEach
yosin_UTC9 2016/07/21 02:20:23 Done.
+ assert_selection(
+ '<div contenteditable>\u0E27\u0E31|</div>',
+ selection => {
internals.settings.setEditingBehavior(platform);
-
- testarea.focus();
- moveSelectionForwardByCharacterCommand();
- moveSelectionForwardByCharacterCommand();
- sendBackwardDeleteKey();
- execUndoCommand();
- if (testarea.textContent == "\u0E27\u0E31")
- log("Succeeded for " + platform);
- else
- log("Failed. Actual: \"" + testarea.value + "\", Expected: \"\u0E27\u0E31\"");
- }
- function editingTest() {
- if (window.testRunner)
- testRunner.dumpAsText();
- runTestOn("mac");
- runTestOn("win");
- runTestOn("unix");
- runTestOn("android");
- }
- </script>
- <title>Editing Test (Undo deleting a ligature)</title>
- </head>
- <body>
- <p>This test tests whether the undo command works when the BackSpace key deletes the last character of a ligature "&#x0E27;&#x0E31;".</p>
- <p>If this test succeeds, you can see "&#x0E27;&#x0E31;" (U+0E27,U+0E31) and a string "succeeded" for each platform below.</p>
- <div id="test" contenteditable>&#x0E27;&#x0E31;</div>
- <ul id="console"></ul>
- <script language="javascript" type="text/javascript">
- runEditingTest();
- </script>
- </body>
-</html>
+ selection.document.defaultView.focus();
+ eventSender.keyDown('Backspace', null);
+ selection.document.execCommand('undo');
+ },
+ platform === 'mac'
yoichio 2016/07/21 01:49:17 if mac is special case, could you make another ass
yosin_UTC9 2016/07/21 02:20:23 I don't think it is worth to do. If we move "mac"
yoichio 2016/07/21 04:52:11 I just suggest ['win', 'unix', 'android'].forEach(
+ ? '<div contenteditable>\u0E27|\u0E31^</div>'
+ : '<div contenteditable>\u0E27\u0E31|</div>');
+ }, `${platform}: Undo of backspace key on ligature U+0E27 and U+0E31`));
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/deleting/delete-ligature-003-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698