| Index: third_party/WebKit/LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-detached-no-crash.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-detached-no-crash.html b/third_party/WebKit/LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-detached-no-crash.html
|
| index 551d650e50f9887dc494f02a34f7a9ee65acb3f1..c08a1cae1fd82d546c1f95c7d7dfc0b280b306cc 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-detached-no-crash.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-detached-no-crash.html
|
| @@ -1,57 +1,61 @@
|
| -<!DOCTYPE HTML>
|
| +<!DOCTYPE html>
|
| <html>
|
| -<head>
|
| -<script src="../../resources/js-test.js"></script>
|
| -<script src="../resources/audit-util.js"></script>
|
| -</head>
|
| -<body>
|
| -<script>
|
| -description("Tests document-detached use of AudioContext, pass if no crash.");
|
| + <head>
|
| + <title>
|
| + scriptprocessornode-detached-no-crash.html
|
| + </title>
|
| + <script src="../../resources/js-test.js"></script>
|
| + <script src="../resources/audit-util.js"></script>
|
| + </head>
|
| + <body>
|
| + <script id="layout-test-code">
|
| + description(
|
| + 'Tests document-detached use of AudioContext, pass if no crash.');
|
|
|
| -window.jsTestIsAsync = true;
|
| + window.jsTestIsAsync = true;
|
|
|
| -var sampleRate = 44100.0;
|
| -var renderLengthInFrames = 512;
|
| -var bufferSize = 512;
|
| -var context;
|
| -var node;
|
| -function runTest()
|
| -{
|
| - try {
|
| - node = context.createScriptProcessor(bufferSize, 0, 1);
|
| - var source = context.createBufferSource();
|
| - source.buffer = createImpulseBuffer(context, bufferSize);
|
| - node.onaudioprocess = function(e) { };
|
| - source.connect(node);
|
| - node.connect(context.destination);
|
| - source.start(0);
|
| + let sampleRate = 44100.0;
|
| + let renderLengthInFrames = 512;
|
| + let bufferSize = 512;
|
| + let context;
|
| + let node;
|
| + function runTest() {
|
| + try {
|
| + node = context.createScriptProcessor(bufferSize, 0, 1);
|
| + let source = context.createBufferSource();
|
| + source.buffer = createImpulseBuffer(context, bufferSize);
|
| + node.onaudioprocess = function(e) {};
|
| + source.connect(node);
|
| + node.connect(context.destination);
|
| + source.start(0);
|
|
|
| - context.startRendering();
|
| - } catch (e) {
|
| - // The context has been stopped and detached; nothing to test.
|
| - return;
|
| - }
|
| -}
|
| + context.startRendering();
|
| + } catch (e) {
|
| + // The context has been stopped and detached; nothing to test.
|
| + return;
|
| + }
|
| + }
|
|
|
| -var w;
|
| -function processMessage(event) {
|
| - if (event.data == "opened") {
|
| - context = new w.OfflineAudioContext(1, renderLengthInFrames, sampleRate);
|
| - w.close();
|
| - } else if (event.data == "closed") {
|
| - runTest();
|
| - finishJSTest();
|
| - }
|
| -}
|
| + let w;
|
| + function processMessage(event) {
|
| + if (event.data == 'opened') {
|
| + context =
|
| + new w.OfflineAudioContext(1, renderLengthInFrames, sampleRate);
|
| + w.close();
|
| + } else if (event.data == 'closed') {
|
| + runTest();
|
| + finishJSTest();
|
| + }
|
| + }
|
|
|
| -if (window.testRunner) {
|
| - testRunner.dumpAsText();
|
| - testRunner.waitUntilDone();
|
| - testRunner.setCanOpenWindows();
|
| -}
|
| + if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| + testRunner.waitUntilDone();
|
| + testRunner.setCanOpenWindows();
|
| + }
|
|
|
| -w = window.open('../../resources/window-postmessage-open-close.html');
|
| -window.addEventListener("message", processMessage, false);
|
| -</script>
|
| -</body>
|
| + w = window.open('../../resources/window-postmessage-open-close.html');
|
| + window.addEventListener('message', processMessage, false);
|
| + </script>
|
| + </body>
|
| </html>
|
|
|