Chromium Code Reviews| 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 "วั".</p> |
| - <p>If this test succeeds, you can see "วั" (U+0E27,U+0E31) and a string "succeeded" for each platform below.</p> |
| - <div id="test" contenteditable>วั</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> |