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

Unified Diff: chrome/test/data/file_manager/unit_tests/mocks/mock_folder_shortcut_data_model.js

Issue 48623002: [Files.app] Add an unittest of NavigationListModel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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: chrome/test/data/file_manager/unit_tests/mocks/mock_folder_shortcut_data_model.js
diff --git a/chrome/test/data/file_manager/unit_tests/mocks/mock_folder_shortcut_data_model.js b/chrome/test/data/file_manager/unit_tests/mocks/mock_folder_shortcut_data_model.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec1a43cb0c1353022abfec1e01189e34f3e68977
--- /dev/null
+++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_folder_shortcut_data_model.js
@@ -0,0 +1,27 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * Mock class for FolderShortcutDataModel.
+ * @param {...string} var_args List of the initial shortcuts.
+ * @extends {cr.ui.ArrayDataModel}
+ * @constructor
+ */
+function MockFolderShortcutDataModel(var_args) {
+ cr.ui.ArrayDataModel.apply(this, arguments);
+}
+
+MockFolderShortcutDataModel.prototype = {
+ __proto__: cr.ui.ArrayDataModel.prototype
+};
+
+/**
+ * Mock function for FolderShortcutDataModel.compare().
+ * @param {string} a First parameter to be compared.
+ * @param {string} b Second parameter to be compared with.
+ * @return {number} Negative if a < b, positive if a > b, or zero if a == b.
+ */
+MockFolderShortcutDataModel.prototype.compare = function(a, b) {
+ return a.localeCompare(b);
+};

Powered by Google App Engine
This is Rietveld 408576698