| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../../http/tests/inspector/resources/inspector-test.js"></script> |
| <script src="../resources/log-pause-location.js"></script> |
| <script> |
| function a() { |
| return 1; |
| } |
| |
| function tag(strings, ...values) { |
| return "ignored"; |
| } |
| |
| function entryTemplateString() { |
| let x; |
| debugger; |
| let str = `literal ${1} assignment ${x=1} call ${a()} call2 ${a()}`; |
| } |
| |
| function entryTaggedTemplateString() { |
| let x; |
| debugger; |
| let str = tag`literal ${1} assignment ${x=1} call ${a()} call2 ${a()}`; |
| } |
| |
| // --------- |
| |
| function test() |
| { |
| let suite = InspectorTest.createAsyncSuite("Debugger.stepping.template-string"); |
| |
| window.initializeSteppingTestSuite(suite); |
| |
| addSteppingTestCase({ |
| name: "Debugger.stepping.TemplateStringStepOver", |
| description: "Should be able to step through a template string.", |
| expression: "setTimeout(entryTemplateString)", |
| steps: [ |
| "over", |
| "over", // complete: `...` - leaving entry |
| "resume", |
| ] |
| }); |
| |
| addSteppingTestCase({ |
| name: "Debugger.stepping.TemplateStringStepIn", |
| description: "Should be able to step into template string expressions.", |
| expression: "setTimeout(entryTemplateString)", |
| steps: [ |
| "over", |
| // FIXME: Opportunity to pause at assignment expressions. |
| "in", // into 1st a |
| "out", // out of a - before 2nd a() |
| "in", // into 2nd a |
| "out", // out of a - leaving entry |
| "resume", |
| ] |
| }); |
| |
| addSteppingTestCase({ |
| name: "Debugger.stepping.TaggedTemplateStringStepOver", |
| description: "Should be able to step through a template string.", |
| expression: "setTimeout(entryTaggedTemplateString)", |
| steps: [ |
| "over", |
| "over", // complete: tag`...` - leaving entry |
| "resume", |
| ] |
| }); |
| |
| addSteppingTestCase({ |
| name: "Debugger.stepping.TaggedTemplateStringStepIn", |
| description: "Should be able to step into template string expressions and tag function.", |
| expression: "setTimeout(entryTaggedTemplateString)", |
| steps: [ |
| "over", |
| // FIXME: Opportunity to pause at assignment expressions. |
| "in", // into 1st a |
| "out", // out of a - before 2nd a() |
| "in", // into 2nd a |
| "out", // out of a - before tag |
| "in", // into tag |
| "out", // out of tag - leaving entry |
| "resume", |
| ] |
| }); |
| |
| loadMainPageContent().then(() => { |
| suite.runTestCasesAndFinish(); |
| }); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Checking pause locations when stepping in, out, and over template strings.</p> |
| </body> |
| </html> |