current-time-block-size.html (650B)
1 <!DOCTYPE html> 2 <title>Test currentTime at completion of OfflineAudioContext rendering</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script> 6 promise_test(function() { 7 // sampleRate is a power of two so that time can be represented exactly 8 // in double currentTime. 9 var context = new OfflineAudioContext(1, 1, 65536); 10 return context.startRendering(). 11 then(function(buffer) { 12 assert_equals(buffer.length, 1, "buffer length"); 13 assert_equals(context.currentTime, 128 / context.sampleRate, 14 "currentTime at completion"); 15 }); 16 }); 17 </script>