| 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/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function testFunction() | 7 function testFunction() |
| 8 { | 8 { |
| 9 var length = 123; | 9 var length = 123; |
| 10 var a = [1, 2, 3]; | 10 var a = [1, 2, 3]; |
| 11 if (a.length) { | 11 if (a.length) { |
| 12 var b = 42; | 12 var b = 42; |
| 13 console.log(a.length); | 13 console.log(a.length); |
| 14 debugger; | 14 debugger; |
| 15 return b; | 15 return b; |
| 16 } | 16 } |
| 17 } | 17 } |
| 18 | 18 |
| 19 var test = function() | 19 var test = function() |
| 20 { | 20 { |
| 21 InspectorTest.startDebuggerTest(step1, true); | 21 InspectorTest.startDebuggerTest(step1, true); |
| 22 | 22 |
| 23 function step1() | 23 function step1() |
| 24 { | 24 { |
| 25 InspectorTest.addSnifferPromise(WebInspector.JavaScriptSourceFrame.proto
type, "_renderDecorations").then(step2); | 25 InspectorTest.addSnifferPromise(Sources.JavaScriptSourceFrame.prototype,
"_renderDecorations").then(step2); |
| 26 InspectorTest.runTestFunctionAndWaitUntilPaused(); | 26 InspectorTest.runTestFunctionAndWaitUntilPaused(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function step2() | 29 function step2() |
| 30 { | 30 { |
| 31 var currentFrame = WebInspector.panels.sources.visibleView; | 31 var currentFrame = UI.panels.sources.visibleView; |
| 32 var decorations = currentFrame.textEditor._decorations; | 32 var decorations = currentFrame.textEditor._decorations; |
| 33 for (var line of decorations.keysArray()) { | 33 for (var line of decorations.keysArray()) { |
| 34 var lineDecorations = Array.from(decorations.get(line)).map(decorati
on => decoration.element.textContent).join(", "); | 34 var lineDecorations = Array.from(decorations.get(line)).map(decorati
on => decoration.element.textContent).join(", "); |
| 35 InspectorTest.addResult(`${line + 1}: ${lineDecorations}`); | 35 InspectorTest.addResult(`${line + 1}: ${lineDecorations}`); |
| 36 } | 36 } |
| 37 InspectorTest.completeDebuggerTest(); | 37 InspectorTest.completeDebuggerTest(); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 </script> | 41 </script> |
| 42 </head> | 42 </head> |
| 43 <body onload="runTest()"> | 43 <body onload="runTest()"> |
| 44 <p>Tests that inline scope variables are rendering correctly.</p> | 44 <p>Tests that inline scope variables are rendering correctly.</p> |
| 45 </body> | 45 </body> |
| 46 </html> | 46 </html> |
| OLD | NEW |