Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 #tableDiv { | 5 #tableDiv { |
| 6 display: table; | 6 display: table; |
| 7 } | 7 } |
| 8 </style> | 8 </style> |
| 9 <script src="../../resources/testharness.js"></script> | 9 <script src="../../resources/testharness.js"></script> |
| 10 <script src="../../resources/testharnessreport.js"></script> | 10 <script src="../../resources/testharnessreport.js"></script> |
| 11 </head> | 11 </head> |
| 12 <body> | 12 <body> |
| 13 <div id="tableDiv" contenteditable="true"></div> | 13 <div id="tableDiv" contenteditable="true"></div> |
| 14 <div id="log"></div> | 14 <div id="log"></div> |
| 15 <script> | 15 <script> |
| 16 function runTest(caretPosition, deleteCommand, expectedString) | 16 function runTest(caretPosition, deleteCommand, expectedString) |
| 17 { | 17 { |
| 18 var testDiv = document.getElementById('tableDiv'); | 18 var testDiv = document.getElementById('tableDiv'); |
| 19 testDiv.innerText = 'ABCD'; | 19 testDiv.innerText = 'ABCD'; |
| 20 | 20 |
| 21 var selection = window.getSelection(); | 21 var selection = window.getSelection(); |
| 22 selection.collapse(testDiv, caretPosition); | 22 selection.collapse(testDiv, caretPosition); |
| 23 | 23 |
| 24 document.execCommand(deleteCommand); | 24 document.execCommand(deleteCommand); |
| 25 assert_equals(document.getElementById('tableDiv').textContent, expectedStrin g); | 25 assert_equals(document.getElementById('tableDiv').textContent, expectedStrin g); |
| 26 } | 26 } |
| 27 | 27 |
| 28 test(function () { | 28 test(function () { |
| 29 runTest(0, "forwardDelete", "ABCD"); | 29 runTest(0, "forwardDelete", "BCD"); |
| 30 runTest(1, "Delete", "ABCD"); | 30 }, "This test verifies that ForwardDelete command is able to successfully delete the first and the last characters of a contenteditable div with display: table. "); |
| 31 }, "This test verifies that we are able to successfully delete the first and the last characters of a contenteditable div with display: table."); | 31 |
|
tkent
2017/03/16 08:16:22
The test was very inconsistent. The description s
| |
| 32 test(function () { | |
| 33 runTest(1, "Delete", "ABC"); | |
| 34 }, "This test verifies that Delete command is able to successfully delete the fi rst and the last characters of a contenteditable div with display: table."); | |
| 32 </script> | 35 </script> |
| 33 </body> | 36 </body> |
| 34 </html> | 37 </html> |
| OLD | NEW |