Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..80d94c9314b3dc7209e4c1860f229dfa8d24829b |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html |
@@ -0,0 +1,46 @@ |
+<html> |
+<head> |
+<script src="../../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../../http/tests/inspector/debugger-test.js"></script> |
+<script> |
+ |
+function testFunction() |
+{ |
+ var length = 123; |
+ var a = [1, 2, 3]; |
+ if (a.length) { |
+ var b = 42; |
+ console.log(a.length); |
+ debugger; |
+ return b; |
+ } |
+} |
+ |
+var test = function() |
+{ |
+ InspectorTest.startDebuggerTest(step1, true); |
+ |
+ function step1() |
+ { |
+ InspectorTest.addSnifferPromise(WebInspector.JavaScriptSourceFrame.prototype, "_renderDecorations").then(step2); |
+ InspectorTest.runTestFunctionAndWaitUntilPaused(); |
+ } |
+ |
+ function step2() |
+ { |
+ var currentFrame = WebInspector.panels.sources.visibleView; |
+ var decorations = currentFrame.textEditor._decorations; |
+ for (var line of decorations.keysArray()) { |
+ var lineDecorations = Array.from(decorations.get(line)).map(decoration => decoration.element.textContent).join(", "); |
+ InspectorTest.addResult(`${line + 1}: ${lineDecorations}`); |
+ } |
+ InspectorTest.completeDebuggerTest(); |
+ } |
+} |
+ |
+</script> |
+</head> |
+<body onload="runTest()"> |
+<p>Tests that inline scope variables are rendering correctly.</p> |
+</body> |
+</html> |