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 volumeType: 'removable', | 10 volumeType: 'removable', |
11 deviceType: 'usb', | 11 deviceType: 'usb', |
12 devicePath: 'system_path_prefix1', | 12 devicePath: 'system_path_prefix1', |
13 isParentDevice: false, | 13 isParentDevice: false, |
14 isReadOnly: false, | 14 isReadOnly: false, |
15 hasMedia: false, | 15 hasMedia: false, |
16 configurable: false, | 16 configurable: false, |
| 17 watchable: true, |
17 source: 'device', | 18 source: 'device', |
18 profile: {profileId: '', displayName: '', isCurrentProfile: true}, | 19 profile: {profileId: '', displayName: '', isCurrentProfile: true}, |
19 }; | 20 }; |
20 | 21 |
21 var expectedVolume2 = { | 22 var expectedVolume2 = { |
22 volumeId: 'removable:mount_path2', | 23 volumeId: 'removable:mount_path2', |
23 volumeLabel: 'mount_path2', | 24 volumeLabel: 'mount_path2', |
24 sourcePath: 'device_path2', | 25 sourcePath: 'device_path2', |
25 volumeType: 'removable', | 26 volumeType: 'removable', |
26 deviceType: 'mobile', | 27 deviceType: 'mobile', |
27 devicePath: 'system_path_prefix2', | 28 devicePath: 'system_path_prefix2', |
28 isParentDevice: true, | 29 isParentDevice: true, |
29 isReadOnly: true, | 30 isReadOnly: true, |
30 hasMedia: true, | 31 hasMedia: true, |
31 configurable: false, | 32 configurable: false, |
| 33 // This is not an MTP device, so it's watchable. |
| 34 // TODO(mtomasz): Add a test for a real MTP device. |
| 35 watchable: true, |
32 source: 'device', | 36 source: 'device', |
33 profile: {profileId: '', displayName: '', isCurrentProfile: true} | 37 profile: {profileId: '', displayName: '', isCurrentProfile: true} |
34 }; | 38 }; |
35 | 39 |
36 var expectedVolume3 = { | 40 var expectedVolume3 = { |
37 volumeId: 'removable:mount_path3', | 41 volumeId: 'removable:mount_path3', |
38 volumeLabel: 'mount_path3', | 42 volumeLabel: 'mount_path3', |
39 sourcePath: 'device_path3', | 43 sourcePath: 'device_path3', |
40 volumeType: 'removable', | 44 volumeType: 'removable', |
41 deviceType: 'optical', | 45 deviceType: 'optical', |
42 devicePath: 'system_path_prefix3', | 46 devicePath: 'system_path_prefix3', |
43 isParentDevice: true, | 47 isParentDevice: true, |
44 isReadOnly: false, | 48 isReadOnly: false, |
45 hasMedia: false, | 49 hasMedia: false, |
46 configurable: false, | 50 configurable: false, |
| 51 watchable: true, |
47 source: 'device', | 52 source: 'device', |
48 profile: {profileId: '', displayName: '', isCurrentProfile: true} | 53 profile: {profileId: '', displayName: '', isCurrentProfile: true} |
49 }; | 54 }; |
50 | 55 |
51 var expectedDownloadsVolume = { | 56 var expectedDownloadsVolume = { |
52 volumeId: /^downloads:Downloads[^\/]*$/, | 57 volumeId: /^downloads:Downloads[^\/]*$/, |
53 volumeLabel: '', | 58 volumeLabel: '', |
54 volumeType: 'downloads', | 59 volumeType: 'downloads', |
55 isReadOnly: false, | 60 isReadOnly: false, |
56 hasMedia: false, | 61 hasMedia: false, |
57 configurable: false, | 62 configurable: false, |
| 63 watchable: true, |
58 source: 'system', | 64 source: 'system', |
59 profile: {profileId: '', displayName: '', isCurrentProfile: true} | 65 profile: {profileId: '', displayName: '', isCurrentProfile: true} |
60 }; | 66 }; |
61 | 67 |
62 var expectedDriveVolume = { | 68 var expectedDriveVolume = { |
63 volumeId: /^drive:drive[^\/]*$/, | 69 volumeId: /^drive:drive[^\/]*$/, |
64 volumeLabel: '', | 70 volumeLabel: '', |
65 sourcePath: /^\/special\/drive[^\/]*$/, | 71 sourcePath: /^\/special\/drive[^\/]*$/, |
66 volumeType: 'drive', | 72 volumeType: 'drive', |
67 isReadOnly: false, | 73 isReadOnly: false, |
68 hasMedia: false, | 74 hasMedia: false, |
69 configurable: false, | 75 configurable: false, |
| 76 watchable: true, |
70 source: 'network', | 77 source: 'network', |
71 profile: {profileId: '', displayName: '', isCurrentProfile: true} | 78 profile: {profileId: '', displayName: '', isCurrentProfile: true} |
72 }; | 79 }; |
73 | 80 |
74 var expectedArchiveVolume = { | 81 var expectedArchiveVolume = { |
75 volumeId: 'archive:archive_mount_path', | 82 volumeId: 'archive:archive_mount_path', |
76 volumeLabel: 'archive_mount_path', | 83 volumeLabel: 'archive_mount_path', |
77 sourcePath: /removable\/mount_path3\/archive.zip$/, | 84 sourcePath: /removable\/mount_path3\/archive.zip$/, |
78 volumeType: 'archive', | 85 volumeType: 'archive', |
79 isReadOnly: true, | 86 isReadOnly: true, |
80 hasMedia: false, | 87 hasMedia: false, |
81 configurable: false, | 88 configurable: false, |
| 89 watchable: true, |
82 source: 'file', | 90 source: 'file', |
83 profile: {profileId: '', displayName: '', isCurrentProfile: true} | 91 profile: {profileId: '', displayName: '', isCurrentProfile: true} |
84 }; | 92 }; |
85 | 93 |
86 var expectedProvidedVolume = { | 94 var expectedProvidedVolume = { |
87 volumeId: 'provided:', | 95 volumeId: 'provided:', |
88 volumeLabel: '', | 96 volumeLabel: '', |
89 volumeType: 'provided', | 97 volumeType: 'provided', |
90 isReadOnly: true, | 98 isReadOnly: true, |
91 hasMedia: false, | 99 hasMedia: false, |
92 configurable: true, | 100 configurable: true, |
| 101 watchable: false, |
93 extensionId: 'testing-extension-id', | 102 extensionId: 'testing-extension-id', |
94 source: 'network', | 103 source: 'network', |
95 mountContext: 'auto', | 104 mountContext: 'auto', |
96 fileSystemId: '', | 105 fileSystemId: '', |
97 profile: {profileId: '', displayName: '', isCurrentProfile: true} | 106 profile: {profileId: '', displayName: '', isCurrentProfile: true} |
98 }; | 107 }; |
99 | 108 |
100 // List of expected mount points. | 109 // List of expected mount points. |
101 // NOTE: this has to be synced with values in file_manager_private_apitest.cc | 110 // NOTE: this has to be synced with values in file_manager_private_apitest.cc |
102 // and values sorted by volumeId. | 111 // and values sorted by volumeId. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 'getMountPoints returned wrong number of mount points.'); | 169 'getMountPoints returned wrong number of mount points.'); |
161 for (var i = 0; i < expectedVolumeList.length; i++) { | 170 for (var i = 0; i < expectedVolumeList.length; i++) { |
162 chrome.test.assertTrue( | 171 chrome.test.assertTrue( |
163 validateObject( | 172 validateObject( |
164 result[i], expectedVolumeList[i], 'volumeMetadata'), | 173 result[i], expectedVolumeList[i], 'volumeMetadata'), |
165 'getMountPoints result[' + i + '] not as expected'); | 174 'getMountPoints result[' + i + '] not as expected'); |
166 } | 175 } |
167 })); | 176 })); |
168 } | 177 } |
169 ]); | 178 ]); |
OLD | NEW |