Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: test/inspector/debugger/resources/break-locations.js

Issue 2710903003: [inspector] added master test for break locations (Closed)
Patch Set: addressed comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « test/inspector/debugger/get-possible-breakpoints-master-expected.txt ('k') | test/inspector/debugger/step-into.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698