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

Side by Side Diff: test/debugger/debug/es6/debug-promises/async-task-event.js

Issue 2532693002: [debug-wrapper] AsyncTaskEvent event type (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | test/debugger/debug/es6/debug-promises/throw-uncaught-uncaught.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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
6 Debug = debug.Debug;
7
8 var base_id = -1;
9 var exception = null;
10 var expected = [
11 "enqueue #1",
12 "willHandle #1",
13 "then #1",
14 "enqueue #2",
15 "didHandle #1",
16 "willHandle #2",
17 "then #2",
18 "didHandle #2",
19 "enqueue #3",
20 "willHandle #3",
21 "didHandle #3"
22 ];
23
24 function assertLog(msg) {
25 print(msg);
26 assertTrue(expected.length > 0);
27 assertEquals(expected.shift(), msg);
28 if (!expected.length) {
29 Debug.setListener(null);
30 }
31 }
32
33 function listener(event, exec_state, event_data, data) {
34 if (event != Debug.DebugEvent.AsyncTaskEvent) return;
35 try {
36 if (base_id < 0)
37 base_id = event_data.id();
38 var id = event_data.id() - base_id + 1;
39 assertEquals("Promise.resolve", event_data.name());
40 assertLog(event_data.type() + " #" + id);
41 } catch (e) {
42 print(e + e.stack)
43 exception = e;
44 }
45 }
46
47 Debug.setListener(listener);
48
49 var resolver;
50 var p = new Promise(function(resolve, reject) {
51 resolver = resolve;
52 });
53 p.then(function() {
54 assertLog("then #1");
55 }).then(function() {
56 assertLog("then #2");
57 });
58 resolver();
59
60 %RunMicrotasks();
61
62 assertNull(exception);
OLDNEW
« no previous file with comments | « no previous file | test/debugger/debug/es6/debug-promises/throw-uncaught-uncaught.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698