OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <style> | |
5 #tableDiv { | |
6 display: table; | |
7 } | |
8 </style> | |
9 <script src="../../resources/js-test.js"></script> | |
10 </head> | |
11 <body> | |
12 <div id="tableDiv" contenteditable="true"></div> | |
13 <div id="log"></div> | |
14 <script> | |
15 function testIt(caretPosition, deleteCommand, expectedString) | |
leviw_travelin_and_unemployed
2013/11/26 01:39:43
Nit: runTest? Also a description of the test would
arpitab_
2013/11/26 09:09:09
Done.
| |
16 { | |
17 var testDiv = document.getElementById('tableDiv'); | |
18 testDiv.innerText = 'ABCD'; | |
19 | |
20 var selection = window.getSelection(); | |
21 selection.collapse(testDiv, caretPosition); | |
22 | |
23 document.execCommand(deleteCommand); | |
24 shouldBeEqualToString("document.getElementById('tableDiv').textContent", exp ectedString); | |
25 } | |
26 | |
27 testIt(0, "forwardDelete", "BCD"); | |
28 testIt(1, "Delete", "ABC"); | |
29 | |
30 if (window.testRunner) | |
31 document.getElementById('tableDiv').outerHTML = ''; | |
32 | |
33 finishJSTest(); | |
34 </script> | |
35 </body> | |
36 </html> | |
OLD | NEW |