Index: tests/html/audiocontext_test.dart |
diff --git a/tests/html/audiocontext_test.dart b/tests/html/audiocontext_test.dart |
index e5b155899c9628cdc6a23d5685e42f967763ac39..dda3d25a2f0b9c8a6739474d0791ddcbccd636e1 100644 |
--- a/tests/html/audiocontext_test.dart |
+++ b/tests/html/audiocontext_test.dart |
@@ -60,6 +60,8 @@ main() { |
} |
}); |
+ // TODO(9322): This test times out. |
+ /* |
test('onAudioProcess', () { |
if(AudioContext.supported) { |
var completer = new Completer<bool>(); |
@@ -76,5 +78,35 @@ main() { |
return completer.future; |
} |
}); |
+ */ |
+ |
+ test('oscillatorTypes', () { |
+ if(AudioContext.supported) { |
+ AudioContext context = new AudioContext(); |
+ OscillatorNode oscillator = context.createOscillator(); |
+ oscillator.connectNode(context.destination); |
+ |
+ oscillator.type = 'sawtooth'; |
+ expect(oscillator.type, equals('sawtooth')); |
+ |
+ oscillator.type = 'sine'; |
+ expect(oscillator.type, equals('sine')); |
+ |
+ oscillator.type = 'square'; |
+ expect(oscillator.type, equals('square')); |
+ |
+ oscillator.type = 'triangle'; |
+ expect(oscillator.type, equals('triangle')); |
+ |
+ expect(() => oscillator.type = 'somethingUnsupported', throws); |
+ expect(oscillator.type, equals('triangle')); |
+ |
+ expect(() => oscillator.type = 7, throws); |
+ expect(oscillator.type, equals('triangle')); |
+ |
+ expect(() => oscillator.type = ['heap object not a string'], throws); |
+ expect(oscillator.type, equals('triangle')); |
+ } |
+ }); |
}); |
} |