OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/testharness.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="../../resources/testharnessreport.js"></script> |
6 <script src="../resources/audit-util.js"></script> | 6 <script src="../resources/audit-util.js"></script> |
7 <script src="../resources/audit.js"></script> | 7 <script src="../resources/audit.js"></script> |
8 </head> | 8 </head> |
9 | 9 |
10 <body> | 10 <body> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 should( | 51 should( |
52 context.suspend(scheduledSuspendTime), | 52 context.suspend(scheduledSuspendTime), |
53 'Scheduling at ' + renderDuration + ' seconds') | 53 'Scheduling at ' + renderDuration + ' seconds') |
54 .beRejected(); | 54 .beRejected(); |
55 } | 55 } |
56 | 56 |
57 context.resume(); | 57 context.resume(); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 audit.define('test', (task, should) => { | 61 audit.define({ |
62 task.describe('Promise resolution of resume() and suspend()'); | 62 label: 'test', |
| 63 description: 'Promise resolution of resume() and suspend()' |
| 64 }, (task, should) => { |
63 context = new OfflineAudioContext(1, sampleRate * renderDuration, | 65 context = new OfflineAudioContext(1, sampleRate * renderDuration, |
64 sampleRate); | 66 sampleRate); |
65 | 67 |
66 // Schedule the first suspension. | 68 // Schedule the first suspension. |
67 should(() => context.suspend(scheduledSuspendTime) | 69 should(() => context.suspend(scheduledSuspendTime) |
68 .then(() => | 70 .then(() => |
69 onSuspended(should)), | 71 onSuspended(should)), |
70 'Scheduling a new suspend at ' + scheduledSuspendTime + | 72 'Scheduling a new suspend at ' + scheduledSuspendTime + |
71 ' second(s)') | 73 ' second(s)') |
72 .notThrow(); | 74 .notThrow(); |
73 | 75 |
74 context.startRendering().then(function () { | 76 context.startRendering().then(function () { |
75 should(context.state, 'Promise context.state') | 77 should(context.state, 'Promise context.state') |
76 .beEqualTo('closed'); | 78 .beEqualTo('closed'); |
77 }).then(() => task.done()); | 79 }).then(() => task.done()); |
78 }); | 80 }); |
79 | 81 |
80 audit.run(); | 82 audit.run(); |
81 </script> | 83 </script> |
82 | 84 |
83 </body> | 85 </body> |
84 </html> | 86 </html> |
OLD | NEW |