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

Unified Diff: tests/html/audiocontext_test.dart

Issue 28973003: Test for OscillatorNode.type=. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « runtime/vm/object.h ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'));
+ }
+ });
});
}
« no previous file with comments | « runtime/vm/object.h ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698