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

Unified Diff: LayoutTests/webaudio/dom-exceptions.html

Issue 54173005: Signal exceptions if start/stop is called out-of-order or too many times. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | « no previous file | LayoutTests/webaudio/dom-exceptions-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/webaudio/dom-exceptions.html
diff --git a/LayoutTests/webaudio/dom-exceptions.html b/LayoutTests/webaudio/dom-exceptions.html
index f9b1e8458b496a44d886a198e4790838f1e2e9ea..0fae77a626806002539f5ff7c7359cb08304e26c 100644
--- a/LayoutTests/webaudio/dom-exceptions.html
+++ b/LayoutTests/webaudio/dom-exceptions.html
@@ -125,15 +125,42 @@ function runTest() {
shouldNotThrow("source.start()");
shouldNotThrow("source.stop()");
- // It's valid to start a source that has no associated buffer.
+ // It's not clear from the spec, but I think it's valid to call start(). The spec is silent on
+ // what happens if we call stop() afterwards, so don't call it.
shouldNotThrow("source = context.createBufferSource()");
shouldNotThrow("source.start()");
+
+ buffer = context.createBuffer(1,1, context.sampleRate);
+ shouldNotThrow("source = context.createBufferSource()");
+ shouldNotThrow("source.buffer = buffer");
+ shouldThrow("source.stop()");
+
+ buffer = context.createBuffer(1,1, context.sampleRate);
+ shouldNotThrow("source = context.createBufferSource()");
+ shouldNotThrow("source.buffer = buffer");
+ shouldNotThrow("source.start()");
+ shouldThrow("source.start()");
+
+ buffer = context.createBuffer(1,1, context.sampleRate);
+ shouldNotThrow("source = context.createBufferSource()");
+ shouldNotThrow("source.buffer = buffer");
+ shouldNotThrow("source.start()");
shouldNotThrow("source.stop()");
+ shouldThrow("source.stop()");
+
// Start/stop for OscillatorNodes
shouldNotThrow("source = context.createOscillator()");
shouldNotThrow("source.start()");
shouldNotThrow("source.stop()");
+
+ shouldNotThrow("osc = context.createOscillator()");
+ shouldThrow("osc.stop()");
+ shouldNotThrow("osc1 = context.createOscillator()");
+ shouldNotThrow("osc1.start()");
+ shouldNotThrow("osc1.stop()");
+ shouldThrow("osc1.stop()");
+
}
runTest();
« no previous file with comments | « no previous file | LayoutTests/webaudio/dom-exceptions-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698