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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html

Issue 2782443003: Initialize referenceDecodedAudioBuffer correctly. (Closed)
Patch Set: Remove extra blank line Created 3 years, 8 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/TestExpectations ('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 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/audit.js"></script> 6 <script src="../resources/audit.js"></script>
7 <title>Test decodeAudioData promises</title> 7 <title>Test decodeAudioData promises</title>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // correctly. 48 // correctly.
49 audit.define('decode-valid-file', (task, should) => { 49 audit.define('decode-valid-file', (task, should) => {
50 // Note that the order of completion for each promise is undefined and 50 // Note that the order of completion for each promise is undefined and
51 // we do not care about it in this test. 51 // we do not care about it in this test.
52 Promise 52 Promise
53 .all([ 53 .all([
54 // Do not use the original arrayBuffers for decoding; decode a copy 54 // Do not use the original arrayBuffers for decoding; decode a copy
55 // because decodeAudioData will detach the buffers. 55 // because decodeAudioData will detach the buffers.
56 should(context.decodeAudioData(validArrayBuffer.slice(0)), 56 should(context.decodeAudioData(validArrayBuffer.slice(0)),
57 'Decoding a valid audio file') 57 'Decoding a valid audio file')
58 .beResolved(), 58 .beResolved()
59 .then(buffer => referenceDecodedAudioBuffer = buffer),
59 should(context.decodeAudioData(invalidArrayBuffer.slice(0)), 60 should(context.decodeAudioData(invalidArrayBuffer.slice(0)),
60 'Decoding an invalid audio file') 61 'Decoding an invalid audio file')
61 .beRejectedWith('EncodingError'), 62 .beRejectedWith('EncodingError'),
62 should(context.decodeAudioData(null), 'Decoding null AudioBuffer') 63 should(context.decodeAudioData(null), 'Decoding null AudioBuffer')
63 .beRejected() 64 .beRejected()
64 ]) 65 ])
65 .then(() => task.done()); 66 .then(() => task.done());
66 }); 67 });
67 68
68 // Decode a valid file and verify that the promise is fulfilled and the 69 // Decode a valid file and verify that the promise is fulfilled and the
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 onlineContext.close() 166 onlineContext.close()
166 .then(() => { return context.decodeAudioData(validArrayBuffer); }) 167 .then(() => { return context.decodeAudioData(validArrayBuffer); })
167 .then(resolveOrReject, resolveOrReject) 168 .then(resolveOrReject, resolveOrReject)
168 .then(() => { task.done(); }); 169 .then(() => { task.done(); });
169 }); 170 });
170 171
171 audit.run(); 172 audit.run();
172 </script> 173 </script>
173 </body> 174 </body>
174 </html> 175 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698