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 WebInspector.DOMModel.Events) { | 25 for (var key in WebInspector.DOMModel.Events) { |
26 var eventName = WebInspector.DOMModel.Events[key]; | 26 var eventName = WebInspector.DOMModel.Events[key]; |
27 WebInspector.domModel.addEventListener(eventName, InspectorTest.reco
rdEvent.bind(InspectorTest, eventName)); | 27 InspectorTest.domModel.addEventListener(eventName, InspectorTest.rec
ordEvent.bind(InspectorTest, eventName)); |
28 } | 28 } |
29 | 29 |
30 next(); | 30 next(); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 InspectorTest.recordEvent = function(eventName, event) | 34 InspectorTest.recordEvent = function(eventName, event) |
35 { | 35 { |
36 if (!event.data) | 36 if (!event.data) |
37 return; | 37 return; |
(...skipping 29 matching lines...) Expand all Loading... |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 InspectorTest.setOuterHTMLUseUndo = function(newText, next) | 70 InspectorTest.setOuterHTMLUseUndo = function(newText, next) |
71 { | 71 { |
72 InspectorTest.innerSetOuterHTML(newText, false, bringBack); | 72 InspectorTest.innerSetOuterHTML(newText, false, bringBack); |
73 | 73 |
74 function bringBack() | 74 function bringBack() |
75 { | 75 { |
76 InspectorTest.addResult("\nBringing things back\n"); | 76 InspectorTest.addResult("\nBringing things back\n"); |
77 WebInspector.domModel.undo(InspectorTest._dumpOuterHTML.bind(InspectorTe
st, true, next)); | 77 InspectorTest.domModel.undo(InspectorTest._dumpOuterHTML.bind(InspectorT
est, true, next)); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 InspectorTest.innerSetOuterHTML = function(newText, last, next) | 81 InspectorTest.innerSetOuterHTML = function(newText, last, next) |
82 { | 82 { |
83 InspectorTest.DOMAgent.setOuterHTML(InspectorTest.containerId, newText, Insp
ectorTest._dumpOuterHTML.bind(InspectorTest, last, next)); | 83 InspectorTest.DOMAgent.setOuterHTML(InspectorTest.containerId, newText, Insp
ectorTest._dumpOuterHTML.bind(InspectorTest, last, next)); |
84 } | 84 } |
85 | 85 |
86 InspectorTest._dumpOuterHTML = function(last, next) | 86 InspectorTest._dumpOuterHTML = function(last, next) |
87 { | 87 { |
(...skipping 14 matching lines...) Expand all Loading... |
102 InspectorTest.addResult("==========8<=========="); | 102 InspectorTest.addResult("==========8<=========="); |
103 InspectorTest.addResult(text); | 103 InspectorTest.addResult(text); |
104 InspectorTest.addResult("==========>8=========="); | 104 InspectorTest.addResult("==========>8=========="); |
105 if (last) | 105 if (last) |
106 InspectorTest.addResult("\n\n\n"); | 106 InspectorTest.addResult("\n\n\n"); |
107 next(); | 107 next(); |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 }; | 111 }; |
OLD | NEW |