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

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

Issue 2775853002: Fix decode-audio-data-basic.html to test decoding on close context (Closed)
Patch Set: Add more comment. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html b/third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html
index c284544808daba6104907a285d00ace87fabe93d..61eca1264ed487d79fe11740241ae80febbfccb5 100644
--- a/third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html
+++ b/third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html
@@ -8,11 +8,10 @@
</head>
<body>
<script>
- // Use offline context for decoding because we want a fixed known sample
- // rate, independent of the hardware because the test file is encoded at
- // 44.1 kHz. If we don't, decodeAudioData() will resample the data messing
- // up the assumptions in this test. The length is unimportant.
- let context = new OfflineAudioContext(1, 1, 44100);
+ // The functionality of decodeAudioData() is orthogonal to the type and the
+ // state of AudioContext. So we use the online context here and any
+ // resampling of the file is okay for this test.
+ let context = new AudioContext();
// Test file URLs.
let validAudioFileUrl = '../resources/media/24bit-44khz.wav';
@@ -114,8 +113,10 @@
'successCallback should not have invoked');
};
- let decodeAudioDataPromise = context.decodeAudioData(
- invalidArrayBuffer.slice(), successOrErrorCallback, successOrErrorCallback);
+ let decodeAudioDataPromise =
+ context.decodeAudioData(invalidArrayBuffer.slice(),
+ successOrErrorCallback,
+ successOrErrorCallback);
should(decodeAudioDataPromise, 'decodeAudioData promise')
.beRejected('EncodingError')
@@ -124,8 +125,7 @@
// decodeAudioData() should be functional even after the associated context
// is closed.
- // TODO(crbug.com/692650)
- audit.define('close-context-with-pending-decode', (task, should) => {
+ audit.define('decoding-on-closed-context', (task, should) => {
// Use one handler for resolve and reject. |promiseArg| is a parameter for
// handlers; it is a decoded audio buffer for success case and an error
// object for failure case.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698