blob: 0f61eca7ae3b7ec693f278bc04da3ea455a2a268 [file] [log] [blame] [edit]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="resources/compatibility.js"></script>
<script src="resources/audio-testing.js"></script>
<script src="resources/late-start-testing.js"></script>
</head>
<body>
<script>
description('Test the late call of start(0) of BufferSource.');
window.jsTestIsAsync = true;
var audit = Audit.createTaskRunner();
var sampleRate = 44100;
// The long render length (30 seconds) is to make sure the |onstatechange|
// event gets fired to start the source, which can take quite a bit of time.
var renderLength = 30;
var context = new OfflineAudioContext(1, sampleRate * renderLength, sampleRate);
var dcOffsetbuffer = createConstantBuffer(context, 1000, 1.0);
var source = context.createBufferSource();
source.buffer = dcOffsetbuffer;
// Test the buffer node is rendered correctly when the start time of start()
// call is in the past in terms of the context time.
runLateStartTest(audit, context, source);
successfullyParsed = true;
</script>
</body>
</html>