| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 })(); |
| OLD | NEW |