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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/testing/assert_additions.js

Issue 924083004: Shorten Closure template notation from Array.<*> to Array<*> in cvox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * Asserts that a given argument's value is undefined. 6 * Asserts that a given argument's value is undefined.
7 * @param {object} a The argument to check. 7 * @param {object} a The argument to check.
8 */ 8 */
9 function assertUndefined(a) { 9 function assertUndefined(a) {
10 if (a !== undefined) { 10 if (a !== undefined) {
(...skipping 29 matching lines...) Expand all
40 ' - ' + msg); 40 ' - ' + msg);
41 } 41 }
42 return; 42 return;
43 } 43 }
44 44
45 throw new Error('Expected to throw exception ' + error + ' - ' + msg); 45 throw new Error('Expected to throw exception ' + error + ' - ' + msg);
46 } 46 }
47 47
48 /** 48 /**
49 * Asserts that two arrays of strings are equal. 49 * Asserts that two arrays of strings are equal.
50 * @param {Array.<string>} array1 The expected array. 50 * @param {Array<string>} array1 The expected array.
51 * @param {Array.<string>} array2 The test array. 51 * @param {Array<string>} array2 The test array.
52 */ 52 */
53 function assertEqualStringArrays(array1, array2) { 53 function assertEqualStringArrays(array1, array2) {
54 var same = true; 54 var same = true;
55 if (array1.length != array2.length) { 55 if (array1.length != array2.length) {
56 same = false; 56 same = false;
57 } 57 }
58 for (var i = 0; i < Math.min(array1.length, array2.length); i++) { 58 for (var i = 0; i < Math.min(array1.length, array2.length); i++) {
59 if (array1[i].trim() != array2[i].trim()) { 59 if (array1[i].trim() != array2[i].trim()) {
60 same = false; 60 same = false;
61 } 61 }
(...skipping 13 matching lines...) Expand all
75 function assertEqualsJSON(expected, actual, opt_message) { 75 function assertEqualsJSON(expected, actual, opt_message) {
76 if (JSON.stringify(actual) !== JSON.stringify(expected)) { 76 if (JSON.stringify(actual) !== JSON.stringify(expected)) {
77 throw new Error((opt_message ? opt_message + '\n' : '') + 77 throw new Error((opt_message ? opt_message + '\n' : '') +
78 'Expected ' + JSON.stringify(expected) + '\n' + 78 'Expected ' + JSON.stringify(expected) + '\n' +
79 'Got ' + JSON.stringify(actual)); 79 'Got ' + JSON.stringify(actual));
80 } 80 }
81 } 81 }
82 82
83 assertSame = assertEquals; 83 assertSame = assertEquals;
84 assertNotSame = assertNotEquals; 84 assertNotSame = assertNotEquals;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698