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

Side by Side Diff: LayoutTests/fast/js/Promise-init.html

Issue 17505004: Introduce Promises. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 if (window.testRunner)
11 testRunner.dumpAsText();
12
13 description('Test Promise.');
14
15 var thisInInit;
16 var resolver;
17 var promise = new Promise(function(r) {
18 thisInInit = this;
19 resolver = r;
20 });
21
22 shouldBeTrue('promise instanceof Promise');
23 shouldBe('promise.constructor', 'Promise');
24 shouldBe('thisInInit', 'promise');
25 shouldBeTrue('resolver instanceof PromiseResolver');
26 shouldBe('resolver.constructor', 'PromiseResolver');
27
28 shouldThrow('new Promise()', '"TypeError: Promise constructor takes a function a rgument"');
29 shouldThrow('new Promise(37)', '"TypeError: Promise constructor takes a function argument"');
30
31 shouldNotThrow('promise = new Promise(function() { throw Error("foo"); })');
32 // FIXME: We can't test if the promise is rejected now, but should test it in th e future.
33
34 </script>
35 <script src="resources/js-test-post.js"></script>
36 </body>
37 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/js/Promise-init-expected.txt » ('j') | Source/bindings/v8/custom/V8PromiseCustom.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698