Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / edit / mutate-unknown-node.html-disabled
blob65707e0232d5daf95fda3677a439fc5d3dfdf945
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script>
7 function appendChild()
9     var hidden = document.getElementById("hidden");
10     var child = document.createElement("div");
11     child.setAttribute("id", "appended");
12     hidden.appendChild(child);
15 function removeChild()
17     var child = document.getElementById("appended");
18     child.parentNode.removeChild(child);
21 function modifyAttribute()
23     var hidden = document.getElementById("hidden");
24     hidden.setAttribute("foo", "bar");
27 function test()
29     function listener(type, event)
30     {
31         node = event.data.node || event.data;
32         InspectorTest.addResult("DOMAgent event fired. Should only happen once for output node: " + type + " " + event.data.nodeName() + "#" + event.data.getAttribute("id"));
33     }
35     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, listener.bind(this, "DOMAttrModified"));
36     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified, listener.bind(this, "DOMCharacterDataModified"));
37     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeInserted, listener.bind(this, "DOMNodeInserted"));
38     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved, listener.bind(this, "DOMNodeRemoved"));
40     WebInspector.domAgent.requestDocument(step0.bind(this));
42     function step0()
43     {
44         InspectorTest.evaluateInPage("appendChild()", step1);
45     }
47     function step1()
48     {
49         InspectorTest.addResult("Appended");
50         InspectorTest.evaluateInPage("removeChild()", step2);
51     }
53     function step2()
54     {
55         InspectorTest.addResult("Removed");
56         InspectorTest.evaluateInPage("modifyAttribute()", step3);
57     }
59     function step3()
60     {
61         InspectorTest.addResult("Attribute modified");
62         InspectorTest.evaluateInPage("true", step4);
63     }
65     function step4()
66     {
67         InspectorTest.addResult("========= Result DOMAgent tree ========");
68         InspectorTest.dumpDOMAgentTree();
70         InspectorTest.completeTest();
71     }
74 </script>
75 </head>
77 <body onload="runTest()">
78 <p>
79 Tests that elements panel does not receive events upon changes to the undiscovered nodes.
80 </p>
82 <div>
83 <div id="hidden">
84 </div>
85 </div>
87 </body>
88 </html>