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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/Panner/hrtf-database.html

Issue 2708953003: Move task.describe descriptions to audit.define (Closed)
Patch Set: Address review comments. 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
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/onstatechange.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test FLAC-encoded HRTF databse</title> 4 <title>Test FLAC-encoded HRTF databse</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audit.js"></script> 7 <script src="../resources/audit.js"></script>
8 <script src="../resources/buffer-loader.js"></script> 8 <script src="../resources/buffer-loader.js"></script>
9 </head> 9 </head>
10 10
11 <body> 11 <body>
12 <script> 12 <script>
13 // This MUST be the sample rate used by the HTRF database! 13 // This MUST be the sample rate used by the HTRF database!
14 var sampleRate = 44100; 14 var sampleRate = 44100;
15 15
16 var context; 16 var context;
17 var wavBuffer; 17 var wavBuffer;
18 var flacBuffer; 18 var flacBuffer;
19 19
20 var audit = Audit.createTaskRunner(); 20 var audit = Audit.createTaskRunner();
21 21
22 audit.define("loadfiles", function (task, should) { 22 audit.define({
23 task.describe("Load HRTF database files"); 23 label: "loadfiles",
24 description: "Load HRTF database files"
25 }, function (task, should) {
24 26
25 // Any valid context with the right sample rate will do. 27 // Any valid context with the right sample rate will do.
26 context = new OfflineAudioContext(1, 1, sampleRate); 28 context = new OfflineAudioContext(1, 1, sampleRate);
27 29
28 var bufferLoader = new BufferLoader( 30 var bufferLoader = new BufferLoader(
29 context, [ 31 context, [
30 "../../../Source/platform/audio/resources/Composite.wav", 32 "../../../Source/platform/audio/resources/Composite.wav",
31 "../../../Source/platform/audio/resources/Composite.flac", 33 "../../../Source/platform/audio/resources/Composite.flac",
32 ], 34 ],
33 function (bufferList) { 35 function (bufferList) {
34 should(bufferList.length, "Number of buffers loaded") 36 should(bufferList.length, "Number of buffers loaded")
35 .beEqualTo(2); 37 .beEqualTo(2);
36 wavBuffer = bufferList[0]; 38 wavBuffer = bufferList[0];
37 flacBuffer = bufferList[1]; 39 flacBuffer = bufferList[1];
38 task.done(); 40 task.done();
39 }); 41 });
40 42
41 bufferLoader.load(); 43 bufferLoader.load();
42 }); 44 });
43 45
44 audit.define("verify-flac", function (task, should) { 46 audit.define({
45 task.describe("Verify FLAC-encoded HRTF database matches original"); 47 label: "verify-flac",
48 description: "Verify FLAC-encoded HRTF database matches original"
49 }, function (task, should) {
46 50
47 should(flacBuffer.numberOfChannels, "Number of FLAC channels") 51 should(flacBuffer.numberOfChannels, "Number of FLAC channels")
48 .beEqualTo(wavBuffer.numberOfChannels); 52 .beEqualTo(wavBuffer.numberOfChannels);
49 53
50 for (var k = 0; k < wavBuffer.numberOfChannels; ++k) { 54 for (var k = 0; k < wavBuffer.numberOfChannels; ++k) {
51 should(flacBuffer.getChannelData(k), 55 should(flacBuffer.getChannelData(k),
52 "FLAC-encoded HRTF database channel " + k 56 "FLAC-encoded HRTF database channel " + k
53 ) 57 )
54 .beEqualToArray(wavBuffer.getChannelData(k)); 58 .beEqualToArray(wavBuffer.getChannelData(k));
55 } 59 }
56 60
57 task.done(); 61 task.done();
58 }); 62 });
59 63
60 audit.run(); 64 audit.run();
61 </script> 65 </script>
62 </body> 66 </body>
63 </html> 67 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/onstatechange.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698