Index: test/inspector/debugger/resources/break-locations.js |
diff --git a/test/inspector/debugger/step-into.js b/test/inspector/debugger/resources/break-locations.js |
similarity index 78% |
copy from test/inspector/debugger/step-into.js |
copy to test/inspector/debugger/resources/break-locations.js |
index 8d833e36ebca78490849bd9f316d4ce5ed3c0381..c16ae67d0fba40fdb637bb1c5a4ebccc0ff1266a 100644 |
--- a/test/inspector/debugger/step-into.js |
+++ b/test/inspector/debugger/resources/break-locations.js |
@@ -2,13 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-print('Checks possible break locations.'); |
- |
-InspectorTest.addScript(` |
- |
function testEval() { |
eval('// comment only'); |
- eval('// comment only\\n'); |
+ eval('// comment only\n'); |
} |
// function without return |
@@ -241,29 +237,33 @@ async function testPromiseAsyncWithCode() { |
return testPromise; |
} |
-//# sourceURL=test.js`); |
+function returnFunction() { |
+ return returnObject; |
+} |
-InspectorTest.setupScriptMap(); |
-Protocol.Debugger.onPaused(message => { |
- var frames = message.params.callFrames; |
- if (frames.length === 1) { |
- Protocol.Debugger.stepInto(); |
- return; |
+async function testPromiseComplex() { |
+ var nextTest; |
+ var testPromise = new Promise(resolve => nextTest = resolve); |
+ async function main() { |
+ async function foo() { |
+ await Promise.resolve(); |
+ return 42; |
+ } |
+ var x = 1; |
+ var y = 2; |
+ returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await foo((a => 2 *a)(5)); |
+ nextTest(); |
} |
- var scriptId = frames[0].location.scriptId; |
- InspectorTest.log('break at:'); |
- InspectorTest.logCallFrameSourceLocation(frames[0]) |
- .then(() => Protocol.Debugger.stepInto()); |
-}); |
+ main(); |
+ return testPromise; |
+} |
-Protocol.Debugger.enable(); |
-Protocol.Runtime.evaluate({ expression: 'Object.keys(this).filter(name => name.indexOf(\'test\') === 0)', returnByValue: true }) |
- .then(runTests); |
+function twiceDefined() { |
+ return a + b; |
+} |
-function runTests(message) { |
- var tests = message.result.result.value; |
- InspectorTest.runTestSuite(tests.map(test => eval(`(function ${test}(next) { |
- Protocol.Runtime.evaluate({ expression: 'debugger; ${test}()', awaitPromise: ${test.indexOf('testPromise') === 0}}) |
- .then(next); |
- })`))); |
+function twiceDefined() { |
+ return a + b; |
} |
+ |
+//# sourceURL=break-locations.js |