Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / move-node.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/elements-test.js"></script>
5 <script>
6
7 function test()
8 {
9     var containerNode;
10
11     InspectorTest.runTestSuite([
12         function testDumpInitial(next)
13         {
14             function callback(node)
15             {
16                 containerNode = InspectorTest.expandedNodeWithId("container");
17
18                 InspectorTest.addResult("========= Original ========");
19                 InspectorTest.dumpElementsTree(containerNode);
20                 next();
21             }
22             InspectorTest.expandElementsTree(callback);
23         },
24
25         function testDragAndDrop(next)
26         {
27             var treeOutline = WebInspector.panels.elements.treeOutline;
28             treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectionChanged);
29
30             function selectionChanged()
31             {
32                 InspectorTest.addResult("===== Moved child2 =====");
33                 InspectorTest.dumpElementsTree(containerNode);
34                 InspectorTest.addResult("Selection: " + WebInspector.DOMPresentationUtils.fullQualifiedSelector(treeOutline.selectedDOMNode()));
35                 next();
36             }
37
38             treeOutline._treeElementBeingDragged = treeOutline.getCachedTreeElement(InspectorTest.expandedNodeWithId("child2"));
39             var treeElementToDropOn = treeOutline.getCachedTreeElement(InspectorTest.expandedNodeWithId("child4"));
40             treeOutline._doMove(treeElementToDropOn);
41         }
42     ]);
43 }
44
45 </script>
46 </head>
47
48 <body onload="runTest()">
49 <p>
50 Tests elements drag and drop operation internals, verifies post-move selection.
51 </p>
52
53 <div id="container">
54     <div id="child1"></div>
55     <div id="child2"></div>
56     <div id="child3"></div>
57     <div id="child4"></div>
58 </div>
59
60 </body>
61 </html>