blob: b0da541cdc096aceb9b5d6be4a40d668a8b08296 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script>
function test()
{
var containerNode;
InspectorTest.runTestSuite([
function testDumpInitial(next)
{
function callback(node)
{
containerNode = InspectorTest.expandedNodeWithId("container");
InspectorTest.addResult("========= Original ========");
InspectorTest.dumpElementsTree(containerNode);
next();
}
InspectorTest.expandElementsTree(callback);
},
function testDragAndDrop(next)
{
var treeOutline = InspectorTest.firstElementsTreeOutline();
treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectionChanged);
function selectionChanged()
{
InspectorTest.addResult("===== Moved child2 =====");
InspectorTest.dumpElementsTree(containerNode);
InspectorTest.addResult("Selection: " + WebInspector.DOMPresentationUtils.fullQualifiedSelector(treeOutline.selectedDOMNode()));
next();
}
var child2 = InspectorTest.expandedNodeWithId("child2");
var child4 = InspectorTest.expandedNodeWithId("child4");
treeOutline._treeElementBeingDragged = child2[treeOutline._treeElementSymbol];
var treeElementToDropOn = child4[treeOutline._treeElementSymbol];
treeOutline._doMove(treeElementToDropOn);
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
Tests elements drag and drop operation internals, verifies post-move selection.
</p>
<div id="container">
<div id="child1"></div>
<div id="child2"></div>
<div id="child3"></div>
<div id="child4"></div>
</div>
</body>
</html>