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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit.js

Issue 2781643002: Audit should support Uint8Arrays (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * @fileOverview WebAudio layout test utility library. Built around W3C's 7 * @fileOverview WebAudio layout test utility library. Built around W3C's
8 * testharness.js. Includes asynchronous test task manager, 8 * testharness.js. Includes asynchronous test task manager,
9 * assertion utilities. 9 * assertion utilities.
10 * @dependency testharness.js 10 * @dependency testharness.js
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 // Generate a descriptive string from a target value in various types. 58 // Generate a descriptive string from a target value in various types.
59 function _generateDescription (target, options) { 59 function _generateDescription (target, options) {
60 let targetString; 60 let targetString;
61 61
62 switch (typeof target) { 62 switch (typeof target) {
63 case 'object': 63 case 'object':
64 // Handle Arrays. 64 // Handle Arrays.
65 if (target instanceof Array || target instanceof Float32Array || 65 if (target instanceof Array || target instanceof Float32Array ||
66 target instanceof Float64Array) { 66 target instanceof Float64Array || target instanceof Uint8Array) {
67 let arrayElements = target.length < options.numberOfArrayElements 67 let arrayElements = target.length < options.numberOfArrayElements
68 ? String(target) 68 ? String(target)
69 : String(target.slice(0, options.numberOfArrayElements)) + '...'; 69 : String(target.slice(0, options.numberOfArrayElements)) + '...';
70 targetString = '[' + arrayElements + ']'; 70 targetString = '[' + arrayElements + ']';
71 } else { 71 } else {
72 targetString = '' + String(targetString).split(/[\s\]]/)[1]; 72 targetString = '' + String(targetString).split(/[\s\]]/)[1];
73 } 73 }
74 break; 74 break;
75 default: 75 default:
76 targetString = String(target); 76 targetString = String(target);
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 1269
1270 /** 1270 /**
1271 * Load file from a given URL and pass ArrayBuffer to the following promise. 1271 * Load file from a given URL and pass ArrayBuffer to the following promise.
1272 * See |loadFileFromUrl| method for the detail. 1272 * See |loadFileFromUrl| method for the detail.
1273 */ 1273 */
1274 loadFileFromUrl: loadFileFromUrl 1274 loadFileFromUrl: loadFileFromUrl
1275 1275
1276 }; 1276 };
1277 1277
1278 })(); 1278 })();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698