Index: third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html |
diff --git a/third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html b/third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..32496f3146de65155a2534b15acab0684a939df6 |
--- /dev/null |
+++ b/third_party/WebKit/ManualTests/webaudio/osc-exponentialRamp.html |
@@ -0,0 +1,46 @@ |
+<!doctype html> |
+<html> |
+ <head> |
+ <title>Osc with ExponentialRamp (crbug.com/522229)</title> |
+ </head> |
+ |
+ <body> |
+ <script> |
hongchan
2015/10/01 20:20:52
Let us move the script section to the end of body.
|
+ var context = new AudioContext(); |
+ var sawosc = 0; |
hongchan
2015/10/01 20:20:52
0 is not necessary.
|
+ |
+ function updateOsc(event) { |
+ var freq = Math.random() * 440 + 440; |
hongchan
2015/10/01 20:20:52
Be sure to avoid the case freq = 0. Perhaps we can
Raymond Toy
2015/10/01 20:31:23
How can freq be 0? Math.random() returns numbers
hongchan
2015/10/01 22:14:48
Oops. Sorry. I blindly thought it is -1~1. Please
|
+ console.log(context.currentTime); |
hongchan
2015/10/01 20:20:52
Let's remove the console print out.
|
+ sawosc.frequency.exponentialRampToValueAtTime(freq, context.currentTime + 0.025); |
+ } |
+ |
+ function startTest() { |
+ sawosc = context.createOscillator(); |
+ sawosc.type = 'sawtooth'; |
+ sawosc.connect(context.destination); |
+ window.addEventListener('keydown', updateOsc); |
+ sawosc.start(); |
+ } |
+ |
+ function stopTest() { |
+ window.removeEventListener('keydown', updateOsc); |
+ sawosc.stop(); |
+ } |
+ </script> |
+ |
+ <p> |
+ Test from <a href="crbug.com/522229">crbug.com/522229</a>. This test cannot be validated |
+ using an offline context because it requires user interaction. |
+ </p> |
+ <p> |
+ Press the start button to start the test and the stop button to stop it |
hongchan
2015/10/01 20:20:52
A missing period at the end.
|
+ </p> |
+ <p> |
+ Press any set of keys quickly and listen. At no point should audio ever be silent. There |
+ should be no glitches either. If either of these happens, this test has failed. |
+ </p> |
+ <button onclick="startTest()">Start</button> |
+ <button onclick="stopTest()">Stop</button> |
+ </body> |
+</html> |