Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/continue-to-location-markers.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/continue-to-location-markers.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/continue-to-location-markers.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e2f18068469f1013dbba2110435c7761a0604050 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/continue-to-location-markers.html |
@@ -0,0 +1,119 @@ |
+<html> |
+<head> |
+<script src="../../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../../http/tests/inspector/debugger-test.js"></script> |
+<script> |
+ function foo1() { |
+ return 10; |
+ } |
+ |
+ function foo2() { |
+ return {a:x => 2 * x}; |
+ } |
+ |
+ async function bar1() { |
+ return 10; |
+ } |
+ |
+ async function bar2(x) { |
+ return 2 * x; |
+ } |
+ |
+ async function foo3() { |
+ debugger; |
+ var a = foo1() + foo1(); |
+ var b = foo2(); |
+ if (a) { |
+ a = b.a(a); |
+ } |
+ |
+ bar1().then((xxx, yyy) => console.log(xxx)); |
+ bar1().then( (xxx, yyy) => console.log(xxx)); |
+ bar1().then( (xxx, /*zzz*/ yyy /* xyz */) => console.log(xxx)); |
+ bar1().then ( bar2 ); |
+ bar1().then ( console.log() ); |
+ bar1().then ( console.log ); |
+ bar1().then(function(x) { |
+ console.log(x); |
+ }); |
+ bar1().then( async /* comment */ function(x) { |
+ console.log(x); |
+ }); |
+ bar1().then( async function(x) { |
+ console.log(x); |
+ }); |
+ bar1().then(bar2.bind(null)); |
+ bar1().then(() => bar2(5)); |
+ bar1().then(async () => await bar2(5)); |
+ bar1().then(async (x, y) => await bar2(x)); |
+ setTimeout(bar1, 2000); |
+ a = await bar1(); |
+ bar1().then((x, |
+ y) => console.log(x)); |
+ bar1().then(( |
+ x, y) => console.log(x)); |
+ bar1().then(async ( |
+ x, y) => console.log(x)); |
+ bar1().then( |
+ async (x, y) => console.log(x)); |
+ bar1().then( |
+ bar2); |
+ bar1().then((bar2)); |
+ bar1().then(Promise.resolve()); |
+ bar1().then(Promise.resolve(42).then(bar2)); |
+ bar1().then((Promise.resolve())); |
+ |
+ var False = false; |
+ if (False) |
+ bar1().then(bar2); |
+ bar1().then(bar2); |
+ |
+ bar1().then(/* comment */ bar2.bind(null)); |
+ return 10; |
+ } |
+</script> |
+<script> |
+ |
+function testFunction() |
+{ |
+ foo3(); |
+} |
+ |
+var test = function() |
+{ |
+ InspectorTest.startDebuggerTest(step1, true); |
+ |
+ function step1() |
+ { |
+ InspectorTest.addSnifferPromise(Sources.JavaScriptSourceFrame.prototype, "_continueToLocationRenderedForTest").then(step2); |
+ InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype, "setExecutionLocation", function() { |
+ InspectorTest.showUISourceCodePromise(this.uiSourceCode()).then(() => { |
+ this._showContinueToLocations(); |
+ }); |
+ }); |
+ InspectorTest.runTestFunctionAndWaitUntilPaused(); |
+ } |
+ |
+ function step2() |
+ { |
+ var currentFrame = UI.panels.sources.visibleView; |
+ var decorations = currentFrame._continueToLocationDecorations; |
+ var lines = []; |
+ for (var decoration of decorations.keysArray()) { |
+ var find = decoration.find(); |
+ var line = find.from.line; |
+ var text = currentFrame.textEditor.line(line).substring(find.from.ch, find.to.ch); |
+ lines.push(`${decoration.className} @${line + 1}:${find.from.ch} = '${text}'`); |
+ } |
+ lines.sort(); |
+ InspectorTest.addResults(lines); |
+ InspectorTest.completeDebuggerTest(); |
+ } |
+} |
+ |
+</script> |
+</head> |
+<body onload="runTest()"> |
+<p>Tests that continue to location markers are computed correctly.</p> |
+</body> |
+</html> |