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

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

Issue 2746743002: [inspector] support setTimeout in Debugger.scheduleStepIntoAsync method (Closed)
Patch Set: addressed comments Created 3 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 InspectorTest.log('Checks Debugger.scheduleStepIntoAsync with setTimeout.');
6 InspectorTest.setupScriptMap();
7 Protocol.Debugger.enable();
8 InspectorTest.runAsyncTestSuite([
9 async function testSetTimeout() {
10 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(() => 1, 0);'}) ;
11 await Protocol.Debugger.oncePaused();
12 Protocol.Debugger.stepOver();
13 await waitPauseAndDumpLocation();
14 Protocol.Debugger.scheduleStepIntoAsync();
15 Protocol.Debugger.stepOver();
16 await waitPauseAndDumpLocation();
17 await Protocol.Debugger.resume();
18 },
19
20 async function testDebuggerStmtBeforeCallback1() {
21 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(() => 1, 0);deb ugger;'});
22 // should break here, not inside setTimeout callback.
23 Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger\', 0)'});
24 await Protocol.Debugger.oncePaused();
25 Protocol.Debugger.stepOver();
26 await waitPauseAndDumpLocation();
27 Protocol.Debugger.scheduleStepIntoAsync();
28 Protocol.Debugger.stepOver();
29 await waitPauseAndDumpLocation();
30 await Protocol.Debugger.resume();
31 await waitPauseAndDumpLocation();
32 await Protocol.Debugger.resume();
33 },
34
35 async function testDebuggerStmtBeforeCallback2() {
36 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(\'debugger//sho uld-break-here\', 0); setTimeout(() => 1, 0);'});
37 await Protocol.Debugger.oncePaused();
38 Protocol.Debugger.stepOver();
39 await Protocol.Debugger.oncePaused();
40 Protocol.Debugger.stepOver();
41 await waitPauseAndDumpLocation();
42 Protocol.Debugger.scheduleStepIntoAsync();
43 Protocol.Debugger.stepOver();
44 await waitPauseAndDumpLocation();
45 await Protocol.Debugger.resume();
46 await InspectorTest.waitPendingTasks();
47 },
48
49 async function testSetTimeoutWithoutJS() {
50 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(\'}\', 0);setTi meout(\'var a = 239;\', 0);setTimeout(\'debugger\', 0);'});
51 await Protocol.Debugger.oncePaused();
52 Protocol.Debugger.stepOver();
53 await waitPauseAndDumpLocation();
54 Protocol.Debugger.scheduleStepIntoAsync();
55 Protocol.Debugger.stepOver();
56 await waitPauseAndDumpLocation();
57 await Protocol.Debugger.resume();
58 }
59 ]);
60
61 async function waitPauseAndDumpLocation() {
62 var message = await Protocol.Debugger.oncePaused();
63 InspectorTest.log('paused at:');
64 await InspectorTest.logSourceLocation(message.params.callFrames[0].location);
65 return message;
66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698