| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| <link rel="import" href="/base/unittest.html"> |
| <link rel="import" href="/base/raf.html"> |
| <script> |
| 'use strict'; |
| |
| tv.b.unittest.testSuite(function() { |
| |
| |
| test('promise', function() { |
| return new Promise(function(resolve, reject) { |
| resolve(); |
| }); |
| }); |
| |
| test('async', function() { |
| return new Promise(function(resolve) { |
| tv.b.requestAnimationFrame(function() { |
| resolve(); |
| }); |
| }); |
| }); |
| |
| /* To test failures remove comments |
| test('fail', function() { |
| assert.equal(true, false); |
| }); |
| |
| test('rejected-promise', function() { |
| return new Promise(function(resolve, reject){ |
| reject("Failure by rejection"); |
| }); |
| }); |
| |
| test('promise-that-throws-after-resolver', function() { |
| return new Promise(function(resolve, rejet){ |
| throw new Error('blah'); |
| }); |
| }); |
| |
| */ |
| }); |
| </script> |