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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/buffer-loader.js

Issue 2895963003: Apply layout-test-tidy to LayoutTests/webaudio (Closed)
Patch Set: Created 3 years, 7 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
Index: third_party/WebKit/LayoutTests/webaudio/resources/buffer-loader.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/buffer-loader.js b/third_party/WebKit/LayoutTests/webaudio/resources/buffer-loader.js
index f089290aace3c67e695cf0a5189bdc62700c14ad..fc91aa64bf440fa3479570c308760ce5080250e6 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/buffer-loader.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/buffer-loader.js
@@ -1,45 +1,50 @@
function BufferLoader(context, urlList, callback) {
- this.context = context;
- this.urlList = urlList;
- this.onload = callback;
- this.bufferList = new Array();
- this.loadCount = 0;
+ this.context = context;
+ this.urlList = urlList;
+ this.onload = callback;
+ this.bufferList = new Array();
+ this.loadCount = 0;
}
-BufferLoader.prototype.loadBuffer = function(url, index) {
- // Load buffer asynchronously
- var request = new XMLHttpRequest();
- request.open("GET", url, true);
- request.responseType = "arraybuffer";
+BufferLoader.prototype.loadBuffer =
+ function(url, index) {
+ // Load buffer asynchronously
+ let request = new XMLHttpRequest();
+ request.open('GET', url, true);
+ request.responseType = 'arraybuffer';
- var loader = this;
+ let loader = this;
- request.onload = function() {
- loader.context.decodeAudioData(
- request.response,
- function (decodedAudio) {
- try {
- loader.bufferList[index] = decodedAudio;
- if (++loader.loadCount == loader.urlList.length)
- loader.onload(loader.bufferList);
- } catch(e) {
- console.log(e);
- alert('BufferLoader: unable to load buffer ' + index + ", url: " + loader.urlList[index]);
- }
- },
- function () {
- alert('error decoding file data: ' + url);
- });
- }
+ request.onload =
+ function() {
+ loader.context.decodeAudioData(
+ request.response,
+ function(decodedAudio) {
+ try {
+ loader.bufferList[index] = decodedAudio;
+ if (++loader.loadCount == loader.urlList.length)
+ loader.onload(loader.bufferList);
+ } catch (e) {
+ console.log(e);
+ alert(
+ 'BufferLoader: unable to load buffer ' + index +
+ ', url: ' + loader.urlList[index]);
+ }
+ },
+ function() {
+ alert('error decoding file data: ' + url);
+ });
+ }
- request.onerror = function() {
- alert('BufferLoader: XHR error');
- }
+ request.onerror =
+ function() {
+ alert('BufferLoader: XHR error');
+ }
- request.send();
+ request.send();
}
-BufferLoader.prototype.load = function() {
- for (var i = 0; i < this.urlList.length; ++i)
- this.loadBuffer(this.urlList[i], i);
+ BufferLoader.prototype.load = function() {
+ for (let i = 0; i < this.urlList.length; ++i)
+ this.loadBuffer(this.urlList[i], i);
}

Powered by Google App Engine
This is Rietveld 408576698