blob: 183392ca59e67f99a26769e307783fa51799e4cc [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 setAttribute(name, value)
{
var node = document.getElementById("node");
node.setAttribute(name, value);
}
function removeAttribute(name)
{
var node = document.getElementById("node");
node.removeAttribute(name);
}
function test()
{
var targetNode;
InspectorTest.runTestSuite([
function testDumpInitial(next)
{
function callback(node)
{
targetNode = node;
InspectorTest.addResult("========= Original ========");
InspectorTest.dumpElementsTree(targetNode);
next();
}
InspectorTest.selectNodeWithId("node", callback);
},
function testSetAttribute(next)
{
function callback()
{
InspectorTest.addResult("===== Set attribute =====");
InspectorTest.dumpElementsTree(targetNode);
next();
}
InspectorTest.evaluateInPage("setAttribute('name', 'value')", callback);
},
function testRemoveAttribute(next) {
function callback()
{
InspectorTest.addResult("=== Removed attribute ===");
InspectorTest.dumpElementsTree(targetNode);
next();
}
InspectorTest.evaluateInPage("removeAttribute('name')", callback);
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that elements panel updates dom tree structure upon setting attribute.
</p>
<div id="node"></div>
</body>
</html>