Commit 9965b3de authored by yawano's avatar yawano Committed by Commit bot

Add window.IN_TEST in gallery/js/background.js.

window.IN_TEST is not defined in gallery app. It caused a warning of closure compiler, and IN_TEST flag should be set true also in tests of gallery app.

BUG=433728
TEST=GYP_GENERATORS=ninja tools/gyp/gyp --depth . ui/file_manager/gallery/js/compiled_resources.gyp && ninja -C out/Default
out/Release/browser_tests --gtest_filter=*GalleryBrowserTest*

Review URL: https://codereview.chromium.org/817233002

Cr-Commit-Position: refs/heads/master@{#309402}
parent e8cbfd7a
......@@ -35,6 +35,14 @@ function FileManager() {}
*/
Window.prototype.appID;
/**
* A global flag which indicates whether it is in tests or not. This is set in
* gallery/js/background.js.
*
* @type {boolean}
*/
Window.prototype.IN_TEST;
/**
* @type {string}
*/
......
......@@ -222,6 +222,10 @@ if (chrome.app.runtime) {
// If is is run in the browser test, wait for the test resources are installed
// as a component extension, and then load the test resources.
if (chrome.test) {
// Sets a global flag that we are in tests, so other components are aware of
// it.
window.IN_TEST = true;
/** @type {string} */
window.testExtensionId = 'ejhcmmdhhpdhhgmifplfmjobgegbibkn';
chrome.runtime.onMessageExternal.addListener(function(message) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment