OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // These have to be sync'd with file_manager_private_apitest.cc | 5 // These have to be sync'd with file_manager_private_apitest.cc |
6 var expectedVolume1 = { | 6 var expectedVolume1 = { |
7 volumeId: 'removable:mount_path1', | 7 volumeId: 'removable:mount_path1', |
8 volumeLabel: 'mount_path1', | 8 volumeLabel: 'mount_path1', |
9 sourcePath: 'device_path1', | 9 sourcePath: 'device_path1', |
10 volumeSource: 'device', | |
11 volumeType: 'removable', | 10 volumeType: 'removable', |
12 deviceType: 'usb', | 11 deviceType: 'usb', |
13 devicePath: 'system_path_prefix1', | 12 devicePath: 'system_path_prefix1', |
14 isParentDevice: false, | 13 isParentDevice: false, |
15 isReadOnly: false, | 14 isReadOnly: false, |
16 hasMedia: false, | 15 hasMedia: false, |
17 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 16 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
18 }; | 17 }; |
19 | 18 |
20 var expectedVolume2 = { | 19 var expectedVolume2 = { |
21 volumeId: 'removable:mount_path2', | 20 volumeId: 'removable:mount_path2', |
22 volumeLabel: 'mount_path2', | 21 volumeLabel: 'mount_path2', |
23 sourcePath: 'device_path2', | 22 sourcePath: 'device_path2', |
24 volumeSource: 'device', | |
25 volumeType: 'removable', | 23 volumeType: 'removable', |
26 deviceType: 'mobile', | 24 deviceType: 'mobile', |
27 devicePath: 'system_path_prefix2', | 25 devicePath: 'system_path_prefix2', |
28 isParentDevice: true, | 26 isParentDevice: true, |
29 isReadOnly: true, | 27 isReadOnly: true, |
30 hasMedia: true, | 28 hasMedia: true, |
31 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 29 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
32 }; | 30 }; |
33 | 31 |
34 var expectedVolume3 = { | 32 var expectedVolume3 = { |
35 volumeId: 'removable:mount_path3', | 33 volumeId: 'removable:mount_path3', |
36 volumeLabel: 'mount_path3', | 34 volumeLabel: 'mount_path3', |
37 sourcePath: 'device_path3', | 35 sourcePath: 'device_path3', |
38 volumeSource: 'device', | |
39 volumeType: 'removable', | 36 volumeType: 'removable', |
40 deviceType: 'optical', | 37 deviceType: 'optical', |
41 devicePath: 'system_path_prefix3', | 38 devicePath: 'system_path_prefix3', |
42 isParentDevice: true, | 39 isParentDevice: true, |
43 isReadOnly: false, | 40 isReadOnly: false, |
44 hasMedia: false, | 41 hasMedia: false, |
45 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 42 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
46 }; | 43 }; |
47 | 44 |
48 var expectedDownloadsVolume = { | 45 var expectedDownloadsVolume = { |
49 volumeId: /^downloads:Downloads[^\/]*$/, | 46 volumeId: /^downloads:Downloads[^\/]*$/, |
50 volumeLabel: '', | 47 volumeLabel: '', |
51 volumeSource: 'device', | |
52 volumeType: 'downloads', | 48 volumeType: 'downloads', |
53 isReadOnly: false, | 49 isReadOnly: false, |
54 hasMedia: false, | 50 hasMedia: false, |
55 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 51 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
56 }; | 52 }; |
57 | 53 |
58 var expectedDriveVolume = { | 54 var expectedDriveVolume = { |
59 volumeId: /^drive:drive[^\/]*$/, | 55 volumeId: /^drive:drive[^\/]*$/, |
60 volumeLabel: '', | 56 volumeLabel: '', |
61 sourcePath: /^\/special\/drive[^\/]*$/, | 57 sourcePath: /^\/special\/drive[^\/]*$/, |
62 volumeSource: 'network', | |
63 volumeType: 'drive', | 58 volumeType: 'drive', |
64 isReadOnly: false, | 59 isReadOnly: false, |
65 hasMedia: false, | 60 hasMedia: false, |
66 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 61 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
67 }; | 62 }; |
68 | 63 |
69 var expectedArchiveVolume = { | 64 var expectedArchiveVolume = { |
70 volumeId: 'archive:archive_mount_path', | 65 volumeId: 'archive:archive_mount_path', |
71 volumeLabel: 'archive_mount_path', | 66 volumeLabel: 'archive_mount_path', |
72 sourcePath: /removable\/mount_path3\/archive.zip$/, | 67 sourcePath: /removable\/mount_path3\/archive.zip$/, |
73 volumeSource: 'file', | |
74 volumeType: 'archive', | 68 volumeType: 'archive', |
75 isReadOnly: true, | 69 isReadOnly: true, |
76 hasMedia: false, | 70 hasMedia: false, |
77 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 71 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
78 }; | 72 }; |
79 | 73 |
80 // List of expected mount points. | 74 // List of expected mount points. |
81 // NOTE: this has to be synced with values in file_manager_private_apitest.cc | 75 // NOTE: this has to be synced with values in file_manager_private_apitest.cc |
82 // and values sorted by volumeId. | 76 // and values sorted by volumeId. |
83 var expectedVolumeList = [ | 77 var expectedVolumeList = [ |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 'getMountPoints returned wrong number of mount points.'); | 133 'getMountPoints returned wrong number of mount points.'); |
140 for (var i = 0; i < expectedVolumeList.length; i++) { | 134 for (var i = 0; i < expectedVolumeList.length; i++) { |
141 chrome.test.assertTrue( | 135 chrome.test.assertTrue( |
142 validateObject( | 136 validateObject( |
143 result[i], expectedVolumeList[i], 'volumeMetadata'), | 137 result[i], expectedVolumeList[i], 'volumeMetadata'), |
144 'getMountPoints result[' + i + '] not as expected'); | 138 'getMountPoints result[' + i + '] not as expected'); |
145 } | 139 } |
146 })); | 140 })); |
147 } | 141 } |
148 ]); | 142 ]); |
OLD | NEW |