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

Side by Side Diff: ui/file_manager/gallery/js/background.js

Issue 817233002: Add window.IN_TEST in gallery/js/background.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/file_manager/externs/gallery_foreground.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 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 * @param {!Object.<string, string>} stringData String data. 6 * @param {!Object.<string, string>} stringData String data.
7 * @param {!VolumeManager} volumeManager Volume manager. 7 * @param {!VolumeManager} volumeManager Volume manager.
8 * @constructor 8 * @constructor
9 * @struct 9 * @struct
10 */ 10 */
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 launch(selectedEntriesPromise).catch(function(error) { 216 launch(selectedEntriesPromise).catch(function(error) {
217 console.error(error.stack || error); 217 console.error(error.stack || error);
218 }); 218 });
219 }); 219 });
220 } 220 }
221 221
222 // If is is run in the browser test, wait for the test resources are installed 222 // If is is run in the browser test, wait for the test resources are installed
223 // as a component extension, and then load the test resources. 223 // as a component extension, and then load the test resources.
224 if (chrome.test) { 224 if (chrome.test) {
225 // Sets a global flag that we are in tests, so other components are aware of
226 // it.
227 window.IN_TEST = true;
228
225 /** @type {string} */ 229 /** @type {string} */
226 window.testExtensionId = 'ejhcmmdhhpdhhgmifplfmjobgegbibkn'; 230 window.testExtensionId = 'ejhcmmdhhpdhhgmifplfmjobgegbibkn';
227 chrome.runtime.onMessageExternal.addListener(function(message) { 231 chrome.runtime.onMessageExternal.addListener(function(message) {
228 if (message.name !== 'testResourceLoaded') 232 if (message.name !== 'testResourceLoaded')
229 return; 233 return;
230 var script = document.createElement('script'); 234 var script = document.createElement('script');
231 script.src = 235 script.src =
232 'chrome-extension://' + window.testExtensionId + 236 'chrome-extension://' + window.testExtensionId +
233 '/common/test_loader.js'; 237 '/common/test_loader.js';
234 document.documentElement.appendChild(script); 238 document.documentElement.appendChild(script);
235 }); 239 });
236 } 240 }
OLDNEW
« no previous file with comments | « ui/file_manager/externs/gallery_foreground.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698