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

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

Issue 1246253002: Convert i18n_process.css to use /deep/ instead of ::shadow and add tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig@ review 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/css/i18n_process.css ('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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 * @type {Function} 136 * @type {Function}
137 */ 137 */
138 var pendingTearDown = null; 138 var pendingTearDown = null;
139 139
140 /** 140 /**
141 * Runs all functions starting with test and reports success or 141 * Runs all functions starting with test and reports success or
142 * failure of the test suite. 142 * failure of the test suite.
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 try {
147 testCases.push(name); 147 if (typeof window[name] == 'function' && /^test/.test(name))
148 testCases.push(name);
149 } catch(e) {
150 if (location.protocol == 'data:' && e.name == 'SecurityError') {
151 // Sometimes this file gets loaded as a data: URI. That causes issues
152 // when it touches window.caches or window.cookie.
153 } else {
154 throw e;
155 }
156 }
148 } 157 }
149 if (!testCases.length) { 158 if (!testCases.length) {
150 console.error('Failed to find test cases.'); 159 console.error('Failed to find test cases.');
151 cleanTestRun = false; 160 cleanTestRun = false;
152 } 161 }
153 try { 162 try {
154 if (window.setUpPage) 163 if (window.setUpPage)
155 window.setUpPage(); 164 window.setUpPage();
156 } catch(err) { 165 } catch(err) {
157 cleanTestRun = false; 166 cleanTestRun = false;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 * @param {boolean} success Indicates if the test completed successfully. 216 * @param {boolean} success Indicates if the test completed successfully.
208 */ 217 */
209 function endTests(success) { 218 function endTests(success) {
210 domAutomationController.setAutomationId(1); 219 domAutomationController.setAutomationId(1);
211 domAutomationController.send(success ? 'SUCCESS' : 'FAILURE'); 220 domAutomationController.send(success ? 'SUCCESS' : 'FAILURE');
212 } 221 }
213 222
214 window.onerror = function() { 223 window.onerror = function() {
215 endTests(false); 224 endTests(false);
216 }; 225 };
OLDNEW
« no previous file with comments | « ui/webui/resources/css/i18n_process.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698