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_browser_private_apitest.cc | 5 // These have to be sync'd with file_browser_private_apitest.cc |
6 var expectedVolume1 = { | 6 var expectedVolume1 = { |
7 volumeId: 'removable:mount_path1', | 7 volumeId: 'removable:mount_path1', |
8 sourcePath: 'device_path1', | 8 sourcePath: 'device_path1', |
9 volumeType: 'removable', | 9 volumeType: 'removable', |
10 deviceType: 'usb', | 10 deviceType: 'usb', |
11 devicePath: 'system_path_prefix1', | 11 devicePath: 'system_path_prefix1', |
12 deviceLabel: 'drive_label1', | 12 deviceLabel: 'drive_label1', |
13 isParentDevice: false, | 13 isParentDevice: false, |
14 isReadOnly: false, | 14 isReadOnly: false, |
15 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 15 profile: {profileId: "", displayName: /.*/, isCurrentProfile: true} |
16 }; | 16 }; |
17 | 17 |
18 var expectedVolume2 = { | 18 var expectedVolume2 = { |
19 volumeId: 'removable:mount_path2', | 19 volumeId: 'removable:mount_path2', |
20 sourcePath: 'device_path2', | 20 sourcePath: 'device_path2', |
21 volumeType: 'removable', | 21 volumeType: 'removable', |
22 deviceType: 'mobile', | 22 deviceType: 'mobile', |
23 devicePath: 'system_path_prefix2', | 23 devicePath: 'system_path_prefix2', |
24 deviceLabel: 'drive_label2', | 24 deviceLabel: 'drive_label2', |
25 isParentDevice: true, | 25 isParentDevice: true, |
26 isReadOnly: true, | 26 isReadOnly: true, |
27 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 27 profile: {profileId: "", displayName: /.*/, isCurrentProfile: true} |
28 }; | 28 }; |
29 | 29 |
30 var expectedVolume3 = { | 30 var expectedVolume3 = { |
31 volumeId: 'removable:mount_path3', | 31 volumeId: 'removable:mount_path3', |
32 sourcePath: 'device_path3', | 32 sourcePath: 'device_path3', |
33 volumeType: 'removable', | 33 volumeType: 'removable', |
34 deviceType: 'optical', | 34 deviceType: 'optical', |
35 devicePath: 'system_path_prefix3', | 35 devicePath: 'system_path_prefix3', |
36 deviceLabel: 'drive_label3', | 36 deviceLabel: 'drive_label3', |
37 isParentDevice: true, | 37 isParentDevice: true, |
38 isReadOnly: false, | 38 isReadOnly: false, |
39 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 39 profile: {profileId: "", displayName: /.*/, isCurrentProfile: true} |
40 }; | 40 }; |
41 | 41 |
42 var expectedDownloadsVolume = { | 42 var expectedDownloadsVolume = { |
43 volumeId: /^downloads:Downloads[^\/]*$/, | 43 volumeId: /^downloads:Downloads[^\/]*$/, |
44 volumeType: 'downloads', | 44 volumeType: 'downloads', |
45 isReadOnly: false, | 45 isReadOnly: false, |
46 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 46 profile: {profileId: "", displayName: /.*/, isCurrentProfile: true} |
47 }; | 47 }; |
48 | 48 |
49 var expectedDriveVolume = { | 49 var expectedDriveVolume = { |
50 volumeId: /^drive:drive[^\/]*$/, | 50 volumeId: /^drive:drive[^\/]*$/, |
51 sourcePath: /^\/special\/drive[^\/]*$/, | 51 sourcePath: /^\/special\/drive[^\/]*$/, |
52 volumeType: 'drive', | 52 volumeType: 'drive', |
53 isReadOnly: false, | 53 isReadOnly: false, |
54 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 54 profile: {profileId: "", displayName: /.*/, isCurrentProfile: true} |
55 }; | 55 }; |
56 | 56 |
57 var expectedArchiveVolume = { | 57 var expectedArchiveVolume = { |
58 volumeId: 'archive:archive_mount_path', | 58 volumeId: 'archive:archive_mount_path', |
59 sourcePath: /removable\/mount_path3\/archive.zip$/, | 59 sourcePath: /removable\/mount_path3\/archive.zip$/, |
60 volumeType: 'archive', | 60 volumeType: 'archive', |
61 isReadOnly: true, | 61 isReadOnly: true, |
62 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 62 profile: {profileId: "", displayName: /.*/, isCurrentProfile: true} |
63 }; | 63 }; |
64 | 64 |
65 // List of expected mount points. | 65 // List of expected mount points. |
66 // NOTE: this has to be synced with values in file_browser_private_apitest.cc | 66 // NOTE: this has to be synced with values in file_browser_private_apitest.cc |
67 // and values sorted by volumeId. | 67 // and values sorted by volumeId. |
68 var expectedVolumeList = [ | 68 var expectedVolumeList = [ |
69 expectedArchiveVolume, | 69 expectedArchiveVolume, |
70 expectedDownloadsVolume, | 70 expectedDownloadsVolume, |
71 expectedDriveVolume, | 71 expectedDriveVolume, |
72 expectedVolume1, | 72 expectedVolume1, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 'getMountPoints returned wrong number of mount points.'); | 124 'getMountPoints returned wrong number of mount points.'); |
125 for (var i = 0; i < expectedVolumeList.length; i++) { | 125 for (var i = 0; i < expectedVolumeList.length; i++) { |
126 chrome.test.assertTrue( | 126 chrome.test.assertTrue( |
127 validateObject( | 127 validateObject( |
128 result[i], expectedVolumeList[i], 'volumeMetadata'), | 128 result[i], expectedVolumeList[i], 'volumeMetadata'), |
129 'getMountPoints result[' + i + '] not as expected'); | 129 'getMountPoints result[' + i + '] not as expected'); |
130 } | 130 } |
131 })); | 131 })); |
132 } | 132 } |
133 ]); | 133 ]); |
OLD | NEW |