Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / src / tvcm / unittest_test.html
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7 <link rel="import" href="/tvcm/unittest.html">
8 <link rel="import" href="/tvcm/raf.html">
9 <script>
10 'use strict';
11
12 tvcm.unittest.testSuite(function() {
13
14
15   test('promise', function() {
16     return new Promise(function(resolve, reject) {
17       resolve();
18     });
19   });
20
21   test('async', function() {
22     return new Promise(function(resolve) {
23       tvcm.requestAnimationFrame(function() {
24         resolve();
25       });
26     });
27   });
28
29   /* To test failures remove comments
30   test('fail', function() {
31     assertEquals(true, false);
32   });
33
34   test('rejected-promise', function() {
35     return new Promise(function(resolve, reject){
36       reject("Failure by rejection");
37     });
38   });
39
40    test('promise-that-throws-after-resolver', function() {
41     return new Promise(function(resolve, rejet){
42       throw new Error('blah');
43     });
44   });
45
46   */
47 });
48 </script>