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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library AudioContextTest; 1 library AudioContextTest;
2 import '../../pkg/unittest/lib/unittest.dart'; 2 import '../../pkg/unittest/lib/unittest.dart';
3 import '../../pkg/unittest/lib/html_config.dart'; 3 import '../../pkg/unittest/lib/html_config.dart';
4 import 'dart:html'; 4 import 'dart:html';
5 import 'dart:web_audio'; 5 import 'dart:web_audio';
6 import 'dart:async';
6 7
7 main() { 8 main() {
8 9
9 useHtmlConfiguration(); 10 useHtmlConfiguration();
10 11
11 var isAudioContext = 12 var isAudioContext =
12 predicate((x) => x is AudioContext, 'is an AudioContext'); 13 predicate((x) => x is AudioContext, 'is an AudioContext');
13 14
14 test('constructorTest', () { 15 test('constructorTest', () {
15 var ctx = new AudioContext(); 16 var ctx = new AudioContext();
(...skipping 18 matching lines...) Expand all
34 gainNode.connect(context.destination, 0, 0); 35 gainNode.connect(context.destination, 0, 0);
35 expect(gainNode is GainNode, isTrue); 36 expect(gainNode is GainNode, isTrue);
36 37
37 expect(context.createAnalyser() is AnalyserNode, isTrue); 38 expect(context.createAnalyser() is AnalyserNode, isTrue);
38 expect(context.createChannelMerger() is ChannelMergerNode, isTrue); 39 expect(context.createChannelMerger() is ChannelMergerNode, isTrue);
39 expect(context.createChannelSplitter() is ChannelSplitterNode, isTrue); 40 expect(context.createChannelSplitter() is ChannelSplitterNode, isTrue);
40 expect(context.createOscillator() is OscillatorNode, isTrue); 41 expect(context.createOscillator() is OscillatorNode, isTrue);
41 expect(context.createPanner() is PannerNode, isTrue); 42 expect(context.createPanner() is PannerNode, isTrue);
42 expect(context.createScriptProcessor(4096) is ScriptProcessorNode, isTrue); 43 expect(context.createScriptProcessor(4096) is ScriptProcessorNode, isTrue);
43 }); 44 });
45
46 test('onAudioProcess', () {
47 var context = new AudioContext();
48 var scriptProcessor = context.createScriptProcessor(1024, 1, 2);
49 scriptProcessor.connect(context.destination, 0, 0);
50 var completer = new Completer<bool>();
51 bool alreadyCalled = false;
52 scriptProcessor.onAudioProcess = (event) {
53 if (!alreadyCalled) {
54 completer.complete(true);
55 }
56 alreadyCalled = true;
57 };
58 return completer.future;
59 });
44 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698