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

Unified Diff: tests/html/audiocontext_test.dart

Issue 11510013: Making ScriptProcessorNode not an EventTarget. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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: tests/html/audiocontext_test.dart
diff --git a/tests/html/audiocontext_test.dart b/tests/html/audiocontext_test.dart
index 33a7907181e09937bb7bcd291cbb7fd9a9700223..bcb0c8ab258443d9d9034c9000ef5efd98843b9d 100644
--- a/tests/html/audiocontext_test.dart
+++ b/tests/html/audiocontext_test.dart
@@ -3,6 +3,7 @@ import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
import 'dart:html';
import 'dart:web_audio';
+import 'dart:async';
main() {
@@ -41,4 +42,19 @@ main() {
expect(context.createPanner() is PannerNode, isTrue);
expect(context.createScriptProcessor(4096) is ScriptProcessorNode, isTrue);
});
+
+ test('onAudioProcess', () {
+ var context = new AudioContext();
+ var scriptProcessor = context.createScriptProcessor(1024, 1, 2);
+ scriptProcessor.connect(context.destination, 0, 0);
+ var completer = new Completer<bool>();
+ bool alreadyCalled = false;
+ scriptProcessor.onAudioProcess = (event) {
+ if (!alreadyCalled) {
+ completer.complete(true);
+ }
+ alreadyCalled = true;
+ };
+ return completer.future;
+ });
}

Powered by Google App Engine
This is Rietveld 408576698