Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / move-node.html
blobb0da541cdc096aceb9b5d6be4a40d668a8b08296
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>
7 function test()
9 var containerNode;
11 InspectorTest.runTestSuite([
12 function testDumpInitial(next)
14 function callback(node)
16 containerNode = InspectorTest.expandedNodeWithId("container");
18 InspectorTest.addResult("========= Original ========");
19 InspectorTest.dumpElementsTree(containerNode);
20 next();
22 InspectorTest.expandElementsTree(callback);
25 function testDragAndDrop(next)
27 var treeOutline = InspectorTest.firstElementsTreeOutline();
28 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectionChanged);
30 function selectionChanged()
32 InspectorTest.addResult("===== Moved child2 =====");
33 InspectorTest.dumpElementsTree(containerNode);
34 InspectorTest.addResult("Selection: " + WebInspector.DOMPresentationUtils.fullQualifiedSelector(treeOutline.selectedDOMNode()));
35 next();
38 var child2 = InspectorTest.expandedNodeWithId("child2");
39 var child4 = InspectorTest.expandedNodeWithId("child4");
40 treeOutline._treeElementBeingDragged = child2[treeOutline._treeElementSymbol];
41 var treeElementToDropOn = child4[treeOutline._treeElementSymbol];
42 treeOutline._doMove(treeElementToDropOn);
44 ]);
47 </script>
48 </head>
50 <body onload="runTest()">
51 <p>
52 Tests elements drag and drop operation internals, verifies post-move selection.
53 </p>
55 <div id="container">
56 <div id="child1"></div>
57 <div id="child2"></div>
58 <div id="child3"></div>
59 <div id="child4"></div>
60 </div>
62 </body>
63 </html>