Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: LayoutTests/webaudio/scriptprocessornode-detached-no-crash.html

Issue 1111213002: Treat a stopped AudioContext as closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: startRendering() doesn't (directly) raise an exception Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/webaudio/scriptprocessornode-detached-no-crash.html
diff --git a/LayoutTests/webaudio/scriptprocessornode-detached-no-crash.html b/LayoutTests/webaudio/scriptprocessornode-detached-no-crash.html
index 9ab6745d7d42b5d0f9052e8bc66e56bd1fd6aae9..84a4da8ffd5158d8eada437894682aed59a96405 100644
--- a/LayoutTests/webaudio/scriptprocessornode-detached-no-crash.html
+++ b/LayoutTests/webaudio/scriptprocessornode-detached-no-crash.html
@@ -7,7 +7,7 @@
</head>
<body>
<script>
-description("Tests that ScriptProcessorNode event dispatch doesn't fail when detached from document.");
+description("Tests document-detached use of AudioContext, pass if no crash.");
window.jsTestIsAsync = true;
@@ -15,26 +15,23 @@ var sampleRate = 44100.0;
var renderLengthInFrames = 512;
var bufferSize = 512;
var context;
+var node;
function runTest()
{
- var node;
-
try {
node = context.createScriptProcessor(bufferSize, 0, 1);
- testPassed("Successfully created ScriptProcessorNode.");
+ var 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) {
- testFailed("Failed to create ScriptProcessorNode.");
+ // The context has been stopped and detached; nothing to test.
+ return;
}
-
- var source = context.createBufferSource();
- source.buffer = createImpulseBuffer(context, bufferSize);
-
- node.onaudioprocess = function(e) { };
- source.connect(node);
- node.connect(context.destination);
- source.start(0);
-
- context.startRendering();
}
var w;

Powered by Google App Engine
This is Rietveld 408576698