blob: 6e35bfc480934d68777b67b17d2d6cfae9d261ae [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
function test()
{
let suite = InspectorTest.createAsyncSuite("WI.DOMNode");
suite.addTestCase({
name: "WI.DOMNode.attributes",
description: "Test getting the attributes of a node.",
test(resolve, reject) {
WI.domTreeManager.requestDocument((documentNode) => {
WI.domTreeManager.querySelector(documentNode.id, "#test-id", (nodeId) => {
let domNode = WI.domTreeManager.nodeForId(nodeId);
InspectorTest.assert(domNode, "DOMNode exists");
for (let attribute of domNode.attributes())
InspectorTest.log(attribute.name + "=\"" + attribute.value + "\"");
resolve();
});
});
}
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Tests for the WI.DOMNode model object.</p>
<div id="test-id" class="test-class" data-item="test-data"></div>
</body>
</html>