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

Side by Side Diff: ui/webui/resources/js/webui_resource_test.js

Issue 1234753002: Revert "Teach i18nTemplate.process() to handle <link rel=import> and <template>" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « ui/webui/resources/js/i18n_template_no_process.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 */ 143 */
144 function runTests() { 144 function runTests() {
145 for (var name in window) { 145 for (var name in window) {
146 if (typeof window[name] == 'function' && /^test/.test(name)) 146 if (typeof window[name] == 'function' && /^test/.test(name))
147 testCases.push(name); 147 testCases.push(name);
148 } 148 }
149 if (!testCases.length) { 149 if (!testCases.length) {
150 console.error('Failed to find test cases.'); 150 console.error('Failed to find test cases.');
151 cleanTestRun = false; 151 cleanTestRun = false;
152 } 152 }
153 try {
154 if (window.setUpPage)
155 window.setUpPage();
156 } catch(err) {
157 cleanTestRun = false;
158 }
159 continueTesting(); 153 continueTesting();
160 } 154 }
161 155
162 /** 156 /**
163 * Runs the next test in the queue. Reports the test results if the queue is 157 * Runs the next test in the queue. Reports the test results if the queue is
164 * empty. 158 * empty.
165 * @param {boolean=} opt_asyncTestFailure Optional parameter indicated if the 159 * @param {boolean=} opt_asyncTestFailure Optional parameter indicated if the
166 * last asynchronous test failed. 160 * last asynchronous test failed.
167 */ 161 */
168 function continueTesting(opt_asyncTestFailure) { 162 function continueTesting(opt_asyncTestFailure) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 * @param {boolean} success Indicates if the test completed successfully. 201 * @param {boolean} success Indicates if the test completed successfully.
208 */ 202 */
209 function endTests(success) { 203 function endTests(success) {
210 domAutomationController.setAutomationId(1); 204 domAutomationController.setAutomationId(1);
211 domAutomationController.send(success ? 'SUCCESS' : 'FAILURE'); 205 domAutomationController.send(success ? 'SUCCESS' : 'FAILURE');
212 } 206 }
213 207
214 window.onerror = function() { 208 window.onerror = function() {
215 endTests(false); 209 endTests(false);
216 }; 210 };
OLDNEW
« no previous file with comments | « ui/webui/resources/js/i18n_template_no_process.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698