| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * Tests that an observation matches the expected value. | 6 * Tests that an observation matches the expected value. |
| 7 * @param {Object} expected The expected value. | 7 * @param {Object} expected The expected value. |
| 8 * @param {Object} observed The actual value. | 8 * @param {Object} observed The actual value. |
| 9 * @param {string=} opt_message Optional message to include with a test | 9 * @param {string=} opt_message Optional message to include with a test |
| 10 * failure. | 10 * failure. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 assertEquals(expected, observed, opt_message); | 114 assertEquals(expected, observed, opt_message); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * Defines runTests. | 119 * Defines runTests. |
| 120 */ | 120 */ |
| 121 (function(exports) { | 121 (function(exports) { |
| 122 /** | 122 /** |
| 123 * List of test cases. | 123 * List of test cases. |
| 124 * @type {Array.<string>} List of function names for tests to run. | 124 * @type {Array<string>} List of function names for tests to run. |
| 125 */ | 125 */ |
| 126 var testCases = []; | 126 var testCases = []; |
| 127 | 127 |
| 128 /** | 128 /** |
| 129 * Indicates if all tests have run successfully. | 129 * Indicates if all tests have run successfully. |
| 130 * @type {boolean} | 130 * @type {boolean} |
| 131 */ | 131 */ |
| 132 var cleanTestRun = true; | 132 var cleanTestRun = true; |
| 133 | 133 |
| 134 /** | 134 /** |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 * @param {boolean} success Indicates if the test completed successfully. | 201 * @param {boolean} success Indicates if the test completed successfully. |
| 202 */ | 202 */ |
| 203 function endTests(success) { | 203 function endTests(success) { |
| 204 domAutomationController.setAutomationId(1); | 204 domAutomationController.setAutomationId(1); |
| 205 domAutomationController.send(success ? 'SUCCESS' : 'FAILURE'); | 205 domAutomationController.send(success ? 'SUCCESS' : 'FAILURE'); |
| 206 } | 206 } |
| 207 | 207 |
| 208 window.onerror = function() { | 208 window.onerror = function() { |
| 209 endTests(false); | 209 endTests(false); |
| 210 }; | 210 }; |
| OLD | NEW |