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

Side by Side Diff: test/mjsunit/es6/debug-promises-new-event.js

Issue 416213004: Merge three PromiseEvent's into one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix formatting Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/es6/debug-promise-events.js ('k') | tools/generate-runtime-tests.py » ('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 // Flags: --expose-debug-as debug
6
7 Debug = debug.Debug;
8
9 var exception = null;
10 var new_promise;
11
12 function listener(event, exec_state, event_data, data) {
13 if (!(event_data instanceof debug.NewPromiseEvent)) return;
14 try {
15 assertTrue(event_data.resolver().isFunction());
16 assertEquals(resolver, event_data.resolver().value());
17 assertTrue(event_data.resolver().resolved());
18 assertEquals("resolver", event_data.resolver().name());
19 assertTrue(event_data.resolver().source().indexOf("Token") > 0);
20
21 assertTrue(event_data.promise().isPromise());
22 new_promise = event_data.promise().value();
23 assertEquals("pending", event_data.promise().status());
24 } catch (e) {
25 print(e + e.stack)
26 exception = e;
27 }
28 }
29
30 Debug.setListener(listener);
31
32 function resolver(resolve, reject) {
33 resolve(); // Token
34 }
35
36 var p = new Promise(resolver);
37 assertEquals(new_promise, p);
38
39 assertNull(exception);
40 Debug.setListener(null);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/debug-promise-events.js ('k') | tools/generate-runtime-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698