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 17 matching lines...) Expand all Loading... |
28 // verification. | 28 // verification. |
29 var suspendTimes = [0.25, 0.75, 1.0, 0.5, 1.25, 0.0, 1.75]; | 29 var suspendTimes = [0.25, 0.75, 1.0, 0.5, 1.25, 0.0, 1.75]; |
30 | 30 |
31 // Sorted ascending suspend time is our expected result. | 31 // Sorted ascending suspend time is our expected result. |
32 var expectedSuspendTimes = suspendTimes.slice(0).sort(function (a, b) { | 32 var expectedSuspendTimes = suspendTimes.slice(0).sort(function (a, b) { |
33 return a - b; | 33 return a - b; |
34 }); | 34 }); |
35 | 35 |
36 var actualSuspendTimes = []; | 36 var actualSuspendTimes = []; |
37 | 37 |
38 audit.define('test', (task, should) => { | 38 audit.define({ |
39 task.describe('resume() and suspend() with timed sequence'); | 39 label: 'test', |
| 40 description: 'resume() and suspend() with timed sequence' |
| 41 }, (task, should) => { |
40 context = new OfflineAudioContext(1, sampleRate * renderDuration, | 42 context = new OfflineAudioContext(1, sampleRate * renderDuration, |
41 sampleRate); | 43 sampleRate); |
42 | 44 |
43 for (var i = 0; i < suspendTimes.length; i++) { | 45 for (var i = 0; i < suspendTimes.length; i++) { |
44 // Schedule suspends in a random time order, but the actual suspend | 46 // Schedule suspends in a random time order, but the actual suspend |
45 // must happen in ascending time order. | 47 // must happen in ascending time order. |
46 scheduleSuspend(i, suspendTimes[i], should); | 48 scheduleSuspend(i, suspendTimes[i], should); |
47 } | 49 } |
48 | 50 |
49 context.startRendering() | 51 context.startRendering() |
(...skipping 25 matching lines...) Expand all Loading... |
75 ' is ' + i + ' at ' + suspendTimes[scheduledOrder].toFixed(2) + | 77 ' is ' + i + ' at ' + suspendTimes[scheduledOrder].toFixed(2) + |
76 ' second(s)') | 78 ' second(s)') |
77 .beEqualTo(expectedOrder); | 79 .beEqualTo(expectedOrder); |
78 } | 80 } |
79 } | 81 } |
80 | 82 |
81 </script> | 83 </script> |
82 | 84 |
83 </body> | 85 </body> |
84 </html> | 86 </html> |
OLD | NEW |