| Index: third_party/WebKit/LayoutTests/webaudio/constant-source-onended.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/constant-source-onended.html b/third_party/WebKit/LayoutTests/webaudio/constant-source-onended.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fab29150f56f36aec3768d1322d45a52b9ff7b42
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/constant-source-onended.html
|
| @@ -0,0 +1,39 @@
|
| +<!doctype html>
|
| +<html>
|
| + <head>
|
| + <title>Test ConstantSourceNode onended</title>
|
| + <script src="../resources/testharness.js"></script>
|
| + <script src="../resources/testharnessreport.js"></script>
|
| + <script src="resources/audio-testing.js"></script>
|
| + </head>
|
| +
|
| + <body>
|
| + <script>
|
| + var sampleRate = 44100.0;
|
| + // Number of frames that the source will run; fairly arbitrary
|
| + var numberOfFrames = 32;
|
| + // Number of frames to render; arbitrary, but should be larger than
|
| + // numberOfFrames;
|
| + var renderFrames = 16 * numberOfFrames;
|
| +
|
| + var context = new OfflineAudioContext(1, renderFrames, sampleRate);
|
| + var src = new ConstantSourceNode(context);
|
| + src.connect(context.destination);
|
| +
|
| + var tester = async_test("ConstantSourceNode onended event fired");
|
| +
|
| + src.onended = function () {
|
| + tester.step(function () {
|
| + assert_true(true, "ConstantSourceNode.onended fired");
|
| + });
|
| + tester.done();
|
| + };
|
| +
|
| + src.start();
|
| + src.stop(numberOfFrames / context.sampleRate);
|
| +
|
| + context.startRendering();
|
| +
|
| + </script>
|
| + </body>
|
| +</html>
|
|
|