Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / file_manager / unit_tests / mocks / mock_folder_shortcut_data_model.js
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
3 // found in the LICENSE file.
4
5 /**
6  * Mock class for FolderShortcutDataModel.
7  * @param {...MockEntry} var_args List of the initial shortcuts.
8  * @extends {cr.ui.ArrayDataModel}
9  * @constructor
10  */
11 function MockFolderShortcutDataModel(var_args) {
12   cr.ui.ArrayDataModel.apply(this, arguments);
13 }
14
15 MockFolderShortcutDataModel.prototype = {
16   __proto__: cr.ui.ArrayDataModel.prototype
17 };
18
19 /**
20  * Mock function for FolderShortcutDataModel.compare().
21  * @param {MockEntry} a First parameter to be compared.
22  * @param {MockEntry} b Second parameter to be compared with.
23  * @return {number} Negative if a < b, positive if a > b, or zero if a == b.
24  */
25 MockFolderShortcutDataModel.prototype.compare = function(a, b) {
26   return a.fullPath.localeCompare(b.fullPath);
27 };