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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/Oscillator/oscillator-ended.html

Issue 2677723002: Convert Oscillator tests to testharness (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../resources/audit-util.js"></script> 5 <script src="../resources/audit-util.js"></script>
5 <script src="../resources/audio-testing.js"></script> 6 <script src="../resources/audit.js"></script>
6 <script src="../resources/audiobuffersource-testing.js"></script> 7 <script src="../resources/audiobuffersource-testing.js"></script>
8 </head>
9 <body>
7 <script> 10 <script>
11 var audit = Audit.createTaskRunner();
12
8 var context; 13 var context;
9 var source; 14 var source;
10 15
11 function runTest() 16 audit.define("test", function (task, should) {
12 {
13 if (window.testRunner) {
14 testRunner.dumpAsText();
15 testRunner.waitUntilDone();
16 }
17 17
18 var sampleRate = 44100.0; 18 var sampleRate = 44100.0;
19 var lengthInSeconds = 0.1; 19 var lengthInSeconds = 0.1;
20 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, s ampleRate); 20 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, s ampleRate);
21 osc = context.createOscillator(); 21 osc = context.createOscillator();
22 osc.type = "sine"; 22 osc.type = "sine";
23 osc.connect(context.destination); 23 osc.connect(context.destination);
24 osc.onended = function() 24 osc.onended = function()
25 { 25 {
26 testPassed("osc.onended called."); 26 should(true, "osc.onended was called")
27 finishJSTest(); 27 .beTrue();
28 if (window.testRunner) 28 task.done();
29 testRunner.notifyDone();
30
31 } 29 }
32 osc.start(0); 30 osc.start(0);
33 osc.stop(0.1); 31 osc.stop(0.1);
34 context.startRendering(); 32 context.startRendering();
35 } 33 });
34
35 audit.run();
36 </script> 36 </script>
37 </head>
38 <body onload="runTest()">
39 <div>Tests that OscillatorNode calls its onended EventListener.</div>
40 <div id="console"></div>
41 </body> 37 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698