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

Unified Diff: ui/file_manager/file_manager/common/js/unittest_util.js

Issue 2839863002: Add Team Drive subtree to the directory list view. (Closed)
Patch Set: Fix FileManagerJsTest.{NavigationListModelTest,ProvidersModel}. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/common/js/unittest_util.js
diff --git a/ui/file_manager/file_manager/common/js/unittest_util.js b/ui/file_manager/file_manager/common/js/unittest_util.js
index a61fe34b8e1241058187746a1bf28241489ca00d..7f0b0cf9a2bba1b78d8e80badc907ff28fe95763 100644
--- a/ui/file_manager/file_manager/common/js/unittest_util.js
+++ b/ui/file_manager/file_manager/common/js/unittest_util.js
@@ -233,3 +233,28 @@ MockChromeStorageAPI.prototype.set_ = function(values, opt_callback) {
if (opt_callback)
opt_callback();
};
+
+/**
+ * Mocks chrome.commandLinePrivate.
+ * @constructor
+ */
+function MockCommandLinePrivate() {
+ this.flags_ = {};
+ if (!chrome) {
+ chrome = {};
+ }
+ if (!chrome.commandLinePrivate) {
+ chrome.commandLinePrivate = {};
+ }
+ chrome.commandLinePrivate.hasSwitch = function(name, callback) {
+ callback(name in this.flags_);
+ }.bind(this);
+}
+
+/**
+ * Add a switch.
+ * @param {string} name of the switch to add.
+ */
+MockCommandLinePrivate.prototype.addSwitch = function(name) {
+ this.flags_[name] = true;
+};

Powered by Google App Engine
This is Rietveld 408576698