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

Side by Side Diff: test/inspector/debugger/schedule-step-into-async.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 InspectorTest.log('Checks Debugger.scheduleStepIntoAsync.'); 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.sch eduleStepIntoAsync.');
6 6
7 InspectorTest.addScript(` 7 contextGroup.addScript(`
8 function testNoScheduledTask() { 8 function testNoScheduledTask() {
9 debugger; 9 debugger;
10 return 42; 10 return 42;
11 } 11 }
12 12
13 function testSimple() { 13 function testSimple() {
14 debugger; 14 debugger;
15 Promise.resolve().then(v => v * 2); 15 Promise.resolve().then(v => v * 2);
16 } 16 }
17 17
(...skipping 22 matching lines...) Expand all
40 debugger; 40 debugger;
41 Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2); 41 Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
42 } 42 }
43 43
44 function testBlackboxedCreatePromise() { 44 function testBlackboxedCreatePromise() {
45 debugger; 45 debugger;
46 createPromise().then(v => v * 2); 46 createPromise().then(v => v * 2);
47 } 47 }
48 //# sourceURL=test.js`); 48 //# sourceURL=test.js`);
49 49
50 InspectorTest.addScript(` 50 contextGroup.addScript(`
51 51
52 function createPromise() { 52 function createPromise() {
53 return Promise.resolve().then(v => v * 3).then(v => v * 4); 53 return Promise.resolve().then(v => v * 3).then(v => v * 4);
54 } 54 }
55 55
56 //# sourceURL=framework.js`) 56 //# sourceURL=framework.js`)
57 57
58 InspectorTest.setupScriptMap(); 58 session.setupScriptMap();
59 59
60 Protocol.Debugger.enable(); 60 Protocol.Debugger.enable();
61 InspectorTest.runAsyncTestSuite([ 61 InspectorTest.runAsyncTestSuite([
62 async function testScheduleErrors() { 62 async function testScheduleErrors() {
63 Protocol.Runtime.evaluate({ expression: 'testNoScheduledTask()' }); 63 Protocol.Runtime.evaluate({ expression: 'testNoScheduledTask()' });
64 await waitPauseAndDumpLocation(); 64 await waitPauseAndDumpLocation();
65 Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage); 65 Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
66 Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage); 66 Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
67 Protocol.Debugger.stepInto(); 67 Protocol.Debugger.stepInto();
68 await waitPauseAndDumpLocation(); 68 await waitPauseAndDumpLocation();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage); 147 Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
148 Protocol.Debugger.stepOver(); 148 Protocol.Debugger.stepOver();
149 await waitPauseAndDumpLocation(); 149 await waitPauseAndDumpLocation();
150 await Protocol.Debugger.resume(); 150 await Protocol.Debugger.resume();
151 } 151 }
152 ]); 152 ]);
153 153
154 async function waitPauseAndDumpLocation() { 154 async function waitPauseAndDumpLocation() {
155 var message = await Protocol.Debugger.oncePaused(); 155 var message = await Protocol.Debugger.oncePaused();
156 InspectorTest.log('paused at:'); 156 InspectorTest.log('paused at:');
157 InspectorTest.logSourceLocation(message.params.callFrames[0].location); 157 session.logSourceLocation(message.params.callFrames[0].location);
158 return message; 158 return message;
159 } 159 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/return-break-locations.js ('k') | test/inspector/debugger/schedule-step-into-async-set-timeout.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698