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

Side by Side Diff: chrome/test/data/file_manager/unit_tests/mocks/mock_volume_manager.js

Issue 663513003: Add an unittest for background/volume_manager.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase: Changed import_history_unittest to use MockFileSystem. Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 * Mock class for VolumeManager. 6 * Mock class for VolumeManager.
7 * @constructor 7 * @constructor
8 */ 8 */
9 function MockVolumeManager() { 9 function MockVolumeManager() {
10 this.volumeInfoList = new cr.ui.ArrayDataModel([]); 10 this.volumeInfoList = new cr.ui.ArrayDataModel([]);
(...skipping 18 matching lines...) Expand all
29 return null; 29 return null;
30 }; 30 };
31 31
32 /** 32 /**
33 * Utility function to create a mock VolumeInfo. 33 * Utility function to create a mock VolumeInfo.
34 * @param {VolumeType} type Volume type. 34 * @param {VolumeType} type Volume type.
35 * @param {string} path Volume path. 35 * @param {string} path Volume path.
36 * @return {VolumeInfo} Created mock VolumeInfo. 36 * @return {VolumeInfo} Created mock VolumeInfo.
37 */ 37 */
38 MockVolumeManager.createMockVolumeInfo = function(type, volumeId) { 38 MockVolumeManager.createMockVolumeInfo = function(type, volumeId) {
39 var fileSystem = new MockFileSystem(volumeId); 39 var fileSystem = new MockFileSystem(volumeId, 'filesystem:' + volumeId);
40 fileSystem.entries['/'] = new MockDirectoryEntry(fileSystem, '/');
40 41
41 var volumeInfo = new VolumeInfo( 42 var volumeInfo = new VolumeInfo(
42 type, 43 type,
43 volumeId, 44 volumeId,
44 fileSystem, 45 fileSystem,
45 '', // error 46 '', // error
46 '', // deviceType 47 '', // deviceType
47 '', // devicePath 48 '', // devicePath
48 false, // isReadonly 49 false, // isReadonly
49 {isCurrentProfile: true, displayName: ''}, // profile 50 {isCurrentProfile: true, displayName: ''}, // profile
50 ''); // label 51 ''); // label
51 52
52 return volumeInfo; 53 return volumeInfo;
53 }; 54 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698