3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/elements-test.js"></script>
8 function appendNewNode()
10 var element
= document
.querySelector("#first");
11 var second
= document
.createElement("div");
12 element
.parentElement
.appendChild(second
);
17 InspectorTest
.selectNodeWithId("first", onNodeSelected
);
19 function onNodeSelected()
21 InspectorTest
.firstElementsTreeOutline().addEventListener(WebInspector
.ElementsTreeOutline
.Events
.SelectedNodeChanged
, onSelectionChangedEvent
);
22 InspectorTest
.addSniffer(WebInspector
.ElementsTreeOutline
.prototype, "_updateChildren", onNodeAppended
);
23 InspectorTest
.evaluateInPage("appendNewNode()");
26 function onSelectionChangedEvent()
28 InspectorTest
.addResult("ERROR: erroneous selection changed event received.");
29 InspectorTest
.completeTest();
32 function onNodeAppended()
34 InspectorTest
.completeTest();
41 <body onload=
"runTest()">
42 <p>The test verifies that SelectedNodeChanged event is not fired whenever a child gets added to the node.
</p>
44 <div id=
"first">First Child
</div>