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

Unified Diff: LayoutTests/webaudio/javascriptaudionode.html

Issue 14028011: Made AudioNode an EventTarget (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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/javascriptaudionode.html
diff --git a/LayoutTests/webaudio/javascriptaudionode.html b/LayoutTests/webaudio/javascriptaudionode.html
index ab52ebcbbbe84eb4ae1054e370c1b83ff563c38d..41cbd4c2f8af98f1b97c52751a846136d80ebfef 100644
--- a/LayoutTests/webaudio/javascriptaudionode.html
+++ b/LayoutTests/webaudio/javascriptaudionode.html
@@ -75,6 +75,31 @@ function doBufferSizeTest(size) {
}
}
+function performGCTest() {
+ // now test that ScriptProcessorNodes are not garbage collected
+ // if they are unreachable but connected to a running audio context.
+ var context = new webkitOfflineAudioContext(2, renderLengthInFrames, sampleRate);
+
+ window.audioprocessWasCalled = false;
+
+ context.oncomplete = function () {
+ shouldBeTrue('audioprocessWasCalled');
+ finishJSTest();
+ };
+
+ // add the scriptprocessor and callback in a nested function to be sure they'll
+ // be unreachable.
+ (function() {
+ var jsnode = context.createScriptProcessor(bufferSize, 0, 1);
+ jsnode.onaudioprocess = function() {
+ audioprocessWasCalled = true;
+ };
+ jsnode.connect(context.destination);
+ })();
+ gc();
+ context.startRendering();
+}
+
function runTest() {
if (window.testRunner) {
testRunner.dumpAsText();
@@ -148,8 +173,9 @@ function runTest() {
jsnode.onaudioprocess = processAudioData;
bufferSource.noteOn(0);
- context.oncomplete = finishJSTest;
+ context.oncomplete = performGCTest;
context.startRendering();
+
}
runTest();

Powered by Google App Engine
This is Rietveld 408576698