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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-linearRamp-value-attribute.html

Issue 2658703002: Convert AudioParam Audit tests to testharness (Closed)
Patch Set: Rebase test 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 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test linearRampToValue Updates the Param Value</title> 4 <title>Test linearRampToValue Updates the Param Value</title>
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/audit-util.js"></script> 7 <script src="../resources/audit-util.js"></script>
7 <script src="../resources/audio-testing.js"></script> 8 <script src="../resources/audio-testing.js"></script>
8 </head> 9 </head>
9 10
10 <body> 11 <body>
11 <script> 12 <script>
12 description("Test linearRampToValue Updates the Param Value");
13 window.jsTestIsAsync = true;
14 13
15 var renderQuantumSize = 128; 14 var renderQuantumSize = 128;
16 // Should be a power of two to get rid of rounding errors when converting between time and 15 // Should be a power of two to get rid of rounding errors when converting between time and
17 // frame. 16 // frame.
18 var sampleRate = 4096; 17 var sampleRate = 4096;
19 var renderDuration = 1; 18 var renderDuration = 1;
20 // End time of the linear ramp automation 19 // End time of the linear ramp automation
21 var rampEndTime = renderDuration / 2; 20 var rampEndTime = renderDuration / 2;
22 21
23 var audit = Audit.createTaskRunner(); 22 var audit = Audit.createTaskRunner();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 62
64 var frame = context.currentTime * sampleRate - 1; 63 var frame = context.currentTime * sampleRate - 1;
65 success = Should("gain.gain.value at frame " + frame, gain.gain.valu e) 64 success = Should("gain.gain.value at frame " + frame, gain.gain.valu e)
66 .beEqualTo(expected) && success; 65 .beEqualTo(expected) && success;
67 }).then(context.resume.bind(context)); 66 }).then(context.resume.bind(context));
68 } 67 }
69 68
70 // Rock and roll! 69 // Rock and roll!
71 source.start(); 70 source.start();
72 context.startRendering().then(function (result) { 71 context.startRendering().then(function (result) {
73 if (success) 72 Should("linearRampToValue", success)
74 testPassed("linearRampToValue properly set the AudioParam value."); 73 .summarize("properly set the AudioParam value",
75 else 74 "did not properly set the AudioParam value");
76 testFailed("linearRampToValue did not properly set the AudioParam va lue.");
77 }).then(done); 75 }).then(done);
78 }); 76 });
79 77
80 audit.defineTask("finish", function (done) { 78 audit.defineTask("finish", function (done) {
81 finishJSTest();
82 done(); 79 done();
83 }); 80 });
84 81
85 audit.runTasks(); 82 audit.runTasks();
86 </script> 83 </script>
87 </body> 84 </body>
88 </html> 85 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698