blob: fe5ec3cb4e5970831d09fdff98038c81514a8857 [file]
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/elements-test.js"></script>
<script>
function test() {
ElementsTestRunner.selectNodeWithId('test-topic', step1);
function step1() {
TestRunner.reloadPage(step2);
}
function step2() {
TestRunner.deprecatedRunAfterPendingDispatches(step3);
}
function step3() {
// We should have "test-topic" element selected after refresh.
var selectedElement = ElementsTestRunner.firstElementsTreeOutline().selectedTreeElement;
var nodeName = selectedElement ? selectedElement.node().nodeName() : 'null';
TestRunner.addResult('Selected element should be \'P\', was: \'' + nodeName + '\'');
TestRunner.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p id="test-topic">
Tests that elements panel preserves selected node on page refresh.
</p>
</body>
</html>