OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
5 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function appendElement(parentId, childId) | 8 function appendElement(parentId, childId) |
9 { | 9 { |
10 var child = document.createElement("div"); | 10 var child = document.createElement("div"); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 var authorShadowRoot; | 88 var authorShadowRoot; |
89 InspectorTest.runDebuggerTestSuite([ | 89 InspectorTest.runDebuggerTestSuite([ |
90 function testInsertChild(next) | 90 function testInsertChild(next) |
91 { | 91 { |
92 InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is
hit when appending a child."); | 92 InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is
hit when appending a child."); |
93 InspectorTest.nodeWithId("rootElement", step2); | 93 InspectorTest.nodeWithId("rootElement", step2); |
94 | 94 |
95 function step2(node) | 95 function step2(node) |
96 { | 96 { |
97 rootElement = node; | 97 rootElement = node; |
98 pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified,
true); | 98 pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane
.BreakpointTypes.SubtreeModified, true); |
99 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n rootElement."); | 99 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n rootElement."); |
100 InspectorTest.evaluateInPageWithTimeout("appendElement('rootElem
ent', 'childElement')"); | 100 InspectorTest.evaluateInPageWithTimeout("appendElement('rootElem
ent', 'childElement')"); |
101 InspectorTest.addResult("Append childElement to rootElement."); | 101 InspectorTest.addResult("Append childElement to rootElement."); |
102 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); | 102 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); |
103 } | 103 } |
104 }, | 104 }, |
105 | 105 |
106 function testBreakpointToggle(next) | 106 function testBreakpointToggle(next) |
107 { | 107 { |
108 InspectorTest.addResult("Test that DOM breakpoint toggles properly u
sing checkbox."); | 108 InspectorTest.addResult("Test that DOM breakpoint toggles properly u
sing checkbox."); |
109 WebInspector.domBreakpointsSidebarPane._setBreakpoint(rootElement, p
ane._breakpointTypes.AttributeModified, true); | 109 WebInspector.domBreakpointsSidebarPane._setBreakpoint(rootElement, W
ebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); |
110 InspectorTest.addResult("Set DOM breakpoint."); | 110 InspectorTest.addResult("Set DOM breakpoint."); |
111 var elementId = pane._createBreakpointId(rootElement.id, pane._break
pointTypes.AttributeModified); | 111 var elementId = pane._createBreakpointId(rootElement.id, WebInspecto
r.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); |
112 var element = pane._breakpointElements.get(elementId); | 112 var element = pane._breakpointElements.get(elementId); |
113 element._checkboxElement.click(); | 113 element._checkboxElement.click(); |
114 InspectorTest.addResult("Uncheck DOM breakpoint."); | 114 InspectorTest.addResult("Uncheck DOM breakpoint."); |
115 InspectorTest.evaluateInPagePromise("modifyAttribute('rootElement',
'data-test-breakpoint-toggle', 'foo')").then(step2); | 115 InspectorTest.evaluateInPagePromise("modifyAttribute('rootElement',
'data-test-breakpoint-toggle', 'foo')").then(step2); |
116 InspectorTest.addResult("DOM breakpoint should not be hit when disab
led."); | 116 InspectorTest.addResult("DOM breakpoint should not be hit when disab
led."); |
117 | 117 |
118 function step2() | 118 function step2() |
119 { | 119 { |
120 InspectorTest.addResult("Check DOM breakpoint."); | 120 InspectorTest.addResult("Check DOM breakpoint."); |
121 element._checkboxElement.click(); | 121 element._checkboxElement.click(); |
(...skipping 29 matching lines...) Expand all Loading... |
151 function step2() | 151 function step2() |
152 { | 152 { |
153 InspectorTest.waitUntilPaused(step3); | 153 InspectorTest.waitUntilPaused(step3); |
154 InspectorTest.evaluateInPageWithTimeout("breakDebugger()"); | 154 InspectorTest.evaluateInPageWithTimeout("breakDebugger()"); |
155 InspectorTest.addResult("Call breakDebugger, expect it to show u
p in next stack trace."); | 155 InspectorTest.addResult("Call breakDebugger, expect it to show u
p in next stack trace."); |
156 } | 156 } |
157 | 157 |
158 function step3(frames) | 158 function step3(frames) |
159 { | 159 { |
160 InspectorTest.captureStackTrace(frames); | 160 InspectorTest.captureStackTrace(frames); |
161 pane._removeBreakpoint(rootElement, pane._breakpointTypes.Subtre
eModified); | 161 pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsS
idebarPane.BreakpointTypes.SubtreeModified); |
162 InspectorTest.resumeExecution(next); | 162 InspectorTest.resumeExecution(next); |
163 } | 163 } |
164 }, | 164 }, |
165 | 165 |
166 function testModifyAttribute(next) | 166 function testModifyAttribute(next) |
167 { | 167 { |
168 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when modifying attribute."); | 168 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when modifying attribute."); |
169 pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModi
fied, true); | 169 pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarP
ane.BreakpointTypes.AttributeModified, true); |
170 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); | 170 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); |
171 InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElemen
t', 'data-test', 'foo')"); | 171 InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElemen
t', 'data-test', 'foo')"); |
172 InspectorTest.addResult("Modify rootElement data-test attribute."); | 172 InspectorTest.addResult("Modify rootElement data-test attribute."); |
173 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); | 173 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); |
174 | 174 |
175 function step2(callFrames) | 175 function step2(callFrames) |
176 { | 176 { |
177 pane._removeBreakpoint(rootElement, pane._breakpointTypes.Attrib
uteModified); | 177 pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsS
idebarPane.BreakpointTypes.AttributeModified); |
178 next(); | 178 next(); |
179 } | 179 } |
180 }, | 180 }, |
181 | 181 |
182 function testModifyAttrNode(next) | 182 function testModifyAttrNode(next) |
183 { | 183 { |
184 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when modifying Attr node."); | 184 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when modifying Attr node."); |
185 pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModi
fied, true); | 185 pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarP
ane.BreakpointTypes.AttributeModified, true); |
186 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); | 186 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); |
187 InspectorTest.evaluateInPageWithTimeout("modifyAttrNode('rootElement
', 'data-test', 'bar')"); | 187 InspectorTest.evaluateInPageWithTimeout("modifyAttrNode('rootElement
', 'data-test', 'bar')"); |
188 InspectorTest.addResult("Modify rootElement data-test attribute."); | 188 InspectorTest.addResult("Modify rootElement data-test attribute."); |
189 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); | 189 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); |
190 | 190 |
191 function step2(callFrames) | 191 function step2(callFrames) |
192 { | 192 { |
193 pane._removeBreakpoint(rootElement, pane._breakpointTypes.Attrib
uteModified); | 193 pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsS
idebarPane.BreakpointTypes.AttributeModified); |
194 next(); | 194 next(); |
195 } | 195 } |
196 }, | 196 }, |
197 | 197 |
198 function testSetAttrNode(next) | 198 function testSetAttrNode(next) |
199 { | 199 { |
200 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when adding a new Attr node."); | 200 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when adding a new Attr node."); |
201 pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModi
fied, true); | 201 pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarP
ane.BreakpointTypes.AttributeModified, true); |
202 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); | 202 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); |
203 InspectorTest.evaluateInPageWithTimeout("setAttrNode('rootElement',
'data-foo', 'bar')"); | 203 InspectorTest.evaluateInPageWithTimeout("setAttrNode('rootElement',
'data-foo', 'bar')"); |
204 InspectorTest.addResult("Modify rootElement data-foo attribute."); | 204 InspectorTest.addResult("Modify rootElement data-foo attribute."); |
205 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); | 205 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); |
206 | 206 |
207 function step2(callFrames) | 207 function step2(callFrames) |
208 { | 208 { |
209 pane._removeBreakpoint(rootElement, pane._breakpointTypes.Attrib
uteModified); | 209 pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsS
idebarPane.BreakpointTypes.AttributeModified); |
210 next(); | 210 next(); |
211 } | 211 } |
212 }, | 212 }, |
213 | 213 |
214 function testModifyStyleAttribute(next) | 214 function testModifyStyleAttribute(next) |
215 { | 215 { |
216 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when modifying style attribute."); | 216 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint i
s hit when modifying style attribute."); |
217 pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModi
fied, true); | 217 pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarP
ane.BreakpointTypes.AttributeModified, true); |
218 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); | 218 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on
rootElement."); |
219 InspectorTest.evaluateInPageWithTimeout("modifyStyleAttribute('rootE
lement', 'color', 'green')"); | 219 InspectorTest.evaluateInPageWithTimeout("modifyStyleAttribute('rootE
lement', 'color', 'green')"); |
220 InspectorTest.addResult("Modify rootElement style.color attribute.")
; | 220 InspectorTest.addResult("Modify rootElement style.color attribute.")
; |
221 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); | 221 InspectorTest.waitUntilPausedAndDumpStackAndResume(step2); |
222 | 222 |
223 function step2(callFrames) | 223 function step2(callFrames) |
224 { | 224 { |
225 pane._removeBreakpoint(rootElement, pane._breakpointTypes.Attrib
uteModified); | 225 pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsS
idebarPane.BreakpointTypes.AttributeModified); |
226 next(); | 226 next(); |
227 } | 227 } |
228 }, | 228 }, |
229 | 229 |
230 function testRemoveNode(next) | 230 function testRemoveNode(next) |
231 { | 231 { |
232 InspectorTest.addResult("Test that 'Node Removed' breakpoint is hit
when removing a node."); | 232 InspectorTest.addResult("Test that 'Node Removed' breakpoint is hit
when removing a node."); |
233 InspectorTest.nodeWithId("elementToRemove", step2); | 233 InspectorTest.nodeWithId("elementToRemove", step2); |
234 | 234 |
235 function step2(node) | 235 function step2(node) |
236 { | 236 { |
237 pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, tru
e); | 237 pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane
.BreakpointTypes.NodeRemoved, true); |
238 InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on el
ementToRemove."); | 238 InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on el
ementToRemove."); |
239 InspectorTest.evaluateInPageWithTimeout("removeElement('elementT
oRemove')"); | 239 InspectorTest.evaluateInPageWithTimeout("removeElement('elementT
oRemove')"); |
240 InspectorTest.addResult("Remove elementToRemove."); | 240 InspectorTest.addResult("Remove elementToRemove."); |
241 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); | 241 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); |
242 } | 242 } |
243 }, | 243 }, |
244 | 244 |
245 function testReload(next) | 245 function testReload(next) |
246 { | 246 { |
247 InspectorTest.addResult("Test that DOM breakpoints are persisted bet
ween page reloads."); | 247 InspectorTest.addResult("Test that DOM breakpoints are persisted bet
ween page reloads."); |
248 InspectorTest.nodeWithId("rootElement", step2); | 248 InspectorTest.nodeWithId("rootElement", step2); |
249 | 249 |
250 function step2(node) | 250 function step2(node) |
251 { | 251 { |
252 pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified,
true); | 252 pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane
.BreakpointTypes.SubtreeModified, true); |
253 pane._saveBreakpoints(); | 253 pane._saveBreakpoints(); |
254 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n rootElement."); | 254 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n rootElement."); |
255 InspectorTest.reloadPage(step3); | 255 InspectorTest.reloadPage(step3); |
256 } | 256 } |
257 | 257 |
258 function step3() | 258 function step3() |
259 { | 259 { |
260 InspectorTest.expandElementsTree(step4); | 260 InspectorTest.expandElementsTree(step4); |
261 } | 261 } |
262 | 262 |
263 function step4() | 263 function step4() |
264 { | 264 { |
265 InspectorTest.evaluateInPageWithTimeout("appendElement('rootElem
ent', 'childElement')"); | 265 InspectorTest.evaluateInPageWithTimeout("appendElement('rootElem
ent', 'childElement')"); |
266 InspectorTest.addResult("Append childElement to rootElement."); | 266 InspectorTest.addResult("Append childElement to rootElement."); |
267 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); | 267 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); |
268 } | 268 } |
269 }, | 269 }, |
270 | 270 |
271 function testInsertChildIntoAuthorShadowTree(next) | 271 function testInsertChildIntoAuthorShadowTree(next) |
272 { | 272 { |
273 InspectorTest.shadowRootByHostId("hostElement", callback); | 273 InspectorTest.shadowRootByHostId("hostElement", callback); |
274 | 274 |
275 function callback(node) | 275 function callback(node) |
276 { | 276 { |
277 authorShadowRoot = node; | 277 authorShadowRoot = node; |
278 InspectorTest.addResult("Test that 'Subtree Modified' breakpoint
on author shadow root is hit when appending a child."); | 278 InspectorTest.addResult("Test that 'Subtree Modified' breakpoint
on author shadow root is hit when appending a child."); |
279 pane._setBreakpoint(authorShadowRoot, pane._breakpointTypes.Subt
reeModified, true); | 279 pane._setBreakpoint(authorShadowRoot, WebInspector.DOMBreakpoint
sSidebarPane.BreakpointTypes.SubtreeModified, true); |
280 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n author shadow root."); | 280 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n author shadow root."); |
281 InspectorTest.evaluateInPageWithTimeout("appendElementToOpenShad
owRoot('childElement')"); | 281 InspectorTest.evaluateInPageWithTimeout("appendElementToOpenShad
owRoot('childElement')"); |
282 InspectorTest.addResult("Append childElement to author shadow ro
ot."); | 282 InspectorTest.addResult("Append childElement to author shadow ro
ot."); |
283 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); | 283 InspectorTest.waitUntilPausedAndDumpStackAndResume(next); |
284 } | 284 } |
285 }, | 285 }, |
286 | 286 |
287 function testReloadWithShadowElementBreakpoint(next) | 287 function testReloadWithShadowElementBreakpoint(next) |
288 { | 288 { |
289 InspectorTest.nodeWithId("outerElement", step1); | 289 InspectorTest.nodeWithId("outerElement", step1); |
290 | 290 |
291 function step1(node) | 291 function step1(node) |
292 { | 292 { |
293 outerElement = node; | 293 outerElement = node; |
294 | 294 |
295 InspectorTest.addResult("Test that shadow DOM breakpoints are pe
rsisted between page reloads."); | 295 InspectorTest.addResult("Test that shadow DOM breakpoints are pe
rsisted between page reloads."); |
296 pane._setBreakpoint(outerElement, pane._breakpointTypes.SubtreeM
odified, true); | 296 pane._setBreakpoint(outerElement, WebInspector.DOMBreakpointsSid
ebarPane.BreakpointTypes.SubtreeModified, true); |
297 pane._saveBreakpoints(); | 297 pane._saveBreakpoints(); |
298 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n outerElement."); | 298 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint o
n outerElement."); |
299 InspectorTest.reloadPage(step2); | 299 InspectorTest.reloadPage(step2); |
300 } | 300 } |
301 | 301 |
302 function step2() | 302 function step2() |
303 { | 303 { |
304 InspectorTest.expandElementsTree(step3); | 304 InspectorTest.expandElementsTree(step3); |
305 } | 305 } |
306 | 306 |
(...skipping 21 matching lines...) Expand all Loading... |
328 </div> | 328 </div> |
329 | 329 |
330 <div id="hostElement"></div> | 330 <div id="hostElement"></div> |
331 <script> | 331 <script> |
332 var root = document.getElementById("hostElement").createShadowRoot(); | 332 var root = document.getElementById("hostElement").createShadowRoot(); |
333 root.innerHTML = "<div id='outerElement' style='red'><input id='input'/></div>"; | 333 root.innerHTML = "<div id='outerElement' style='red'><input id='input'/></div>"; |
334 </script> | 334 </script> |
335 | 335 |
336 </body> | 336 </body> |
337 </html> | 337 </html> |
OLD | NEW |