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-set-timeout.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 with setTimeout.'); 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.sch eduleStepIntoAsync with setTimeout.');
6 InspectorTest.setupScriptMap(); 6 session.setupScriptMap();
7 Protocol.Debugger.enable(); 7 Protocol.Debugger.enable();
8 InspectorTest.runAsyncTestSuite([ 8 InspectorTest.runAsyncTestSuite([
9 async function testSetTimeout() { 9 async function testSetTimeout() {
10 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(() => 1, 0);'}) ; 10 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(() => 1, 0);'}) ;
11 await Protocol.Debugger.oncePaused(); 11 await Protocol.Debugger.oncePaused();
12 Protocol.Debugger.stepOver(); 12 Protocol.Debugger.stepOver();
13 await waitPauseAndDumpLocation(); 13 await waitPauseAndDumpLocation();
14 Protocol.Debugger.scheduleStepIntoAsync(); 14 Protocol.Debugger.scheduleStepIntoAsync();
15 Protocol.Debugger.stepOver(); 15 Protocol.Debugger.stepOver();
16 await waitPauseAndDumpLocation(); 16 await waitPauseAndDumpLocation();
(...skipping 18 matching lines...) Expand all
35 Protocol.Runtime.evaluate({expression: 'debugger;\nsetTimeout(\'debugger//sh ould-break-here\', 0);\nsetTimeout(() => 1, 0);'}); 35 Protocol.Runtime.evaluate({expression: 'debugger;\nsetTimeout(\'debugger//sh ould-break-here\', 0);\nsetTimeout(() => 1, 0);'});
36 await Protocol.Debugger.oncePaused(); 36 await Protocol.Debugger.oncePaused();
37 Protocol.Debugger.stepOver(); 37 Protocol.Debugger.stepOver();
38 await Protocol.Debugger.oncePaused(); 38 await Protocol.Debugger.oncePaused();
39 Protocol.Debugger.stepOver(); 39 Protocol.Debugger.stepOver();
40 await waitPauseAndDumpLocation(); 40 await waitPauseAndDumpLocation();
41 Protocol.Debugger.scheduleStepIntoAsync(); 41 Protocol.Debugger.scheduleStepIntoAsync();
42 Protocol.Debugger.stepOver(); 42 Protocol.Debugger.stepOver();
43 await waitPauseAndDumpLocation(); 43 await waitPauseAndDumpLocation();
44 await Protocol.Debugger.resume(); 44 await Protocol.Debugger.resume();
45 await InspectorTest.waitPendingTasks(); 45 await InspectorTest.waitForPendingTasks();
46 }, 46 },
47 47
48 async function testSetTimeoutWithoutJS() { 48 async function testSetTimeoutWithoutJS() {
49 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(\'}\', 0);\nset Timeout(\'var a = 239;\', 0);\nsetTimeout(\'debugger//should-break-here\', 0);'} ); 49 Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(\'}\', 0);\nset Timeout(\'var a = 239;\', 0);\nsetTimeout(\'debugger//should-break-here\', 0);'} );
50 await Protocol.Debugger.oncePaused(); 50 await Protocol.Debugger.oncePaused();
51 Protocol.Debugger.stepOver(); 51 Protocol.Debugger.stepOver();
52 await waitPauseAndDumpLocation(); 52 await waitPauseAndDumpLocation();
53 Protocol.Debugger.scheduleStepIntoAsync(); 53 Protocol.Debugger.scheduleStepIntoAsync();
54 Protocol.Debugger.stepOver(); 54 Protocol.Debugger.stepOver();
55 await waitPauseAndDumpLocation(); 55 await waitPauseAndDumpLocation();
56 await Protocol.Debugger.resume(); 56 await Protocol.Debugger.resume();
57 }, 57 },
58 58
59 async function testResume() { 59 async function testResume() {
60 Protocol.Debugger.pause(); 60 Protocol.Debugger.pause();
61 Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'}); 61 Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'});
62 await waitPauseAndDumpLocation(); 62 await waitPauseAndDumpLocation();
63 Protocol.Debugger.scheduleStepIntoAsync(); 63 Protocol.Debugger.scheduleStepIntoAsync();
64 Protocol.Debugger.resume(); 64 Protocol.Debugger.resume();
65 await waitPauseAndDumpLocation(); 65 await waitPauseAndDumpLocation();
66 await Protocol.Debugger.resume(); 66 await Protocol.Debugger.resume();
67 } 67 }
68 ]); 68 ]);
69 69
70 async function waitPauseAndDumpLocation() { 70 async function waitPauseAndDumpLocation() {
71 var message = await Protocol.Debugger.oncePaused(); 71 var message = await Protocol.Debugger.oncePaused();
72 InspectorTest.log('paused at:'); 72 InspectorTest.log('paused at:');
73 await InspectorTest.logSourceLocation(message.params.callFrames[0].location); 73 await session.logSourceLocation(message.params.callFrames[0].location);
74 return message; 74 return message;
75 } 75 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/schedule-step-into-async.js ('k') | test/inspector/debugger/scope-skip-variables-with-empty-name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698