OLD | NEW |
1 var initialize_SetOuterHTMLTest = function() { | 1 var initialize_SetOuterHTMLTest = function() { |
2 | 2 |
3 InspectorTest.events = []; | 3 InspectorTest.events = []; |
4 InspectorTest.containerId; | 4 InspectorTest.containerId; |
5 | 5 |
6 InspectorTest.setUpTestSuite = function(next) | 6 InspectorTest.setUpTestSuite = function(next) |
7 { | 7 { |
8 InspectorTest.expandElementsTree(step1); | 8 InspectorTest.expandElementsTree(step1); |
9 | 9 |
10 function step1() | 10 function step1() |
11 { | 11 { |
12 InspectorTest.selectNodeWithId("container", step2); | 12 InspectorTest.selectNodeWithId("container", step2); |
13 } | 13 } |
14 | 14 |
15 function step2(node) | 15 function step2(node) |
16 { | 16 { |
17 InspectorTest.containerId = node.id; | 17 InspectorTest.containerId = node.id; |
18 InspectorTest.DOMAgent.getOuterHTML(InspectorTest.containerId, step3); | 18 InspectorTest.DOMAgent.getOuterHTML(InspectorTest.containerId, step3); |
19 } | 19 } |
20 | 20 |
21 function step3(error, text) | 21 function step3(error, text) |
22 { | 22 { |
23 InspectorTest.containerText = text; | 23 InspectorTest.containerText = text; |
24 | 24 |
25 for (var key in SDK.DOMModel.Events) { | 25 for (var key in SDK.DOMModel.Events) { |
26 var eventName = SDK.DOMModel.Events[key]; | 26 var eventName = SDK.DOMModel.Events[key]; |
27 if (eventName === SDK.DOMModel.Events.MarkersChanged || eventName ==
= SDK.DOMModel.Events.DOMMutated) | |
28 continue; | |
29 InspectorTest.domModel.addEventListener(eventName, InspectorTest.rec
ordEvent.bind(InspectorTest, eventName)); | 27 InspectorTest.domModel.addEventListener(eventName, InspectorTest.rec
ordEvent.bind(InspectorTest, eventName)); |
30 } | 28 } |
31 | 29 |
32 next(); | 30 next(); |
33 } | 31 } |
34 } | 32 } |
35 | 33 |
36 InspectorTest.recordEvent = function(eventName, event) | 34 InspectorTest.recordEvent = function(eventName, event) |
37 { | 35 { |
38 if (!event.data) | 36 if (!event.data || event.type === SDK.DOMModel.Events.MarkersChanged || even
t.type === SDK.DOMModel.Events.DOMMutated) |
39 return; | 37 return; |
40 var node = event.data.node || event.data; | 38 var node = event.data.node || event.data; |
41 var parent = event.data.parent; | 39 var parent = event.data.parent; |
42 for (var currentNode = parent || node; currentNode; currentNode = currentNod
e.parentNode) { | 40 for (var currentNode = parent || node; currentNode; currentNode = currentNod
e.parentNode) { |
43 if (currentNode.getAttribute("id") === "output") | 41 if (currentNode.getAttribute("id") === "output") |
44 return; | 42 return; |
45 } | 43 } |
46 InspectorTest.events.push("Event " + eventName.toString() + ": " + node.node
Name()); | 44 InspectorTest.events.push("Event " + eventName.toString() + ": " + node.node
Name()); |
47 } | 45 } |
48 | 46 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 InspectorTest.addResult("==========8<=========="); | 102 InspectorTest.addResult("==========8<=========="); |
105 InspectorTest.addResult(text); | 103 InspectorTest.addResult(text); |
106 InspectorTest.addResult("==========>8=========="); | 104 InspectorTest.addResult("==========>8=========="); |
107 if (last) | 105 if (last) |
108 InspectorTest.addResult("\n\n\n"); | 106 InspectorTest.addResult("\n\n\n"); |
109 next(); | 107 next(); |
110 } | 108 } |
111 } | 109 } |
112 | 110 |
113 }; | 111 }; |
OLD | NEW |