Change log level: info -> debug
[framework/web/webkit-efl.git] / LayoutTests / editing / pasteboard / paste-list-002.html
1 <html>
2 <script src=../editing.js></script>
3 <script>
4
5 function editingTest() {
6     // Select "beta" and "gamma".
7     moveSelectionForwardByLineCommand();
8     for (i = 0; i < 2; i++)
9         extendSelectionForwardByLineCommand();
10     copyCommand();
11
12     // Paste with the cursor right before "delta".
13     moveSelectionForwardByLineCommand();
14     pasteCommand();
15
16     // Verify that the cursor is in the right place (still before delta).
17     var selection = window.getSelection();
18     if (selection.baseNode.parentNode != document.getElementById("delta") ||
19         selection.baseOffset != 0 || !selection.isCollapsed)
20         throw "Wrong selection position on before paste.";
21
22     // Paste with the cursor at the end of "delta".
23     moveSelectionForwardByWordCommand();
24     pasteCommand();
25
26     // Verify that the cursor is in the right place (new list item after delta).
27     var selection = window.getSelection();
28     if (!selection.isCollapsed || selection.baseNode.value != "")
29         throw "Wrong selection position on after paste.";
30 }
31
32 </script>
33 <body>
34 <div contentEditable="true">
35 <p>Copy/pasting list items in a list.  This test should be run with DRT for pasteboard access.</p>
36 <p id="results">FAIL</p>
37 <ul id="test">
38     <li>alpha</li>
39     <li>beta</li>
40     <li>gamma</li>
41     <li id="delta">delta</li>
42 </ul>
43 </div>
44
45 <script>
46 if (window.testRunner)
47     testRunner.dumpAsText();
48
49 var elem = document.getElementById("test");
50 var selection = window.getSelection();
51 selection.setPosition(elem, 0);
52 editingTest();
53
54 // Rerun the test but have the source list be indented.
55 document.getElementById("test").innerHTML = "<li>alpha</li><ul><li>beta</li><li>gamma</li></ul><li id='delta'>delta</li>";
56 selection.setPosition(elem, 0);
57 editingTest();
58
59 document.getElementById("results").innerText = "PASS: " + document.getElementById("test").innerHTML;
60 </script>
61
62 </body>
63 </html>