| 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 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 16 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 16 }; | 17 }; |
| 17 | 18 |
| 18 var expectedVolume2 = { | 19 var expectedVolume2 = { |
| 19 volumeId: 'removable:mount_path2', | 20 volumeId: 'removable:mount_path2', |
| 20 volumeLabel: 'mount_path2', | 21 volumeLabel: 'mount_path2', |
| 21 sourcePath: 'device_path2', | 22 sourcePath: 'device_path2', |
| 22 volumeType: 'removable', | 23 volumeType: 'removable', |
| 23 deviceType: 'mobile', | 24 deviceType: 'mobile', |
| 24 devicePath: 'system_path_prefix2', | 25 devicePath: 'system_path_prefix2', |
| 25 isParentDevice: true, | 26 isParentDevice: true, |
| 26 isReadOnly: true, | 27 isReadOnly: true, |
| 28 hasMedia: true, |
| 27 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 29 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 var expectedVolume3 = { | 32 var expectedVolume3 = { |
| 31 volumeId: 'removable:mount_path3', | 33 volumeId: 'removable:mount_path3', |
| 32 volumeLabel: 'mount_path3', | 34 volumeLabel: 'mount_path3', |
| 33 sourcePath: 'device_path3', | 35 sourcePath: 'device_path3', |
| 34 volumeType: 'removable', | 36 volumeType: 'removable', |
| 35 deviceType: 'optical', | 37 deviceType: 'optical', |
| 36 devicePath: 'system_path_prefix3', | 38 devicePath: 'system_path_prefix3', |
| 37 isParentDevice: true, | 39 isParentDevice: true, |
| 38 isReadOnly: false, | 40 isReadOnly: false, |
| 41 hasMedia: false, |
| 39 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 42 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 40 }; | 43 }; |
| 41 | 44 |
| 42 var expectedDownloadsVolume = { | 45 var expectedDownloadsVolume = { |
| 43 volumeId: /^downloads:Downloads[^\/]*$/, | 46 volumeId: /^downloads:Downloads[^\/]*$/, |
| 44 volumeLabel: '', | 47 volumeLabel: '', |
| 45 volumeType: 'downloads', | 48 volumeType: 'downloads', |
| 46 isReadOnly: false, | 49 isReadOnly: false, |
| 50 hasMedia: false, |
| 47 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 51 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 48 }; | 52 }; |
| 49 | 53 |
| 50 var expectedDriveVolume = { | 54 var expectedDriveVolume = { |
| 51 volumeId: /^drive:drive[^\/]*$/, | 55 volumeId: /^drive:drive[^\/]*$/, |
| 52 volumeLabel: '', | 56 volumeLabel: '', |
| 53 sourcePath: /^\/special\/drive[^\/]*$/, | 57 sourcePath: /^\/special\/drive[^\/]*$/, |
| 54 volumeType: 'drive', | 58 volumeType: 'drive', |
| 55 isReadOnly: false, | 59 isReadOnly: false, |
| 60 hasMedia: false, |
| 56 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 61 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 57 }; | 62 }; |
| 58 | 63 |
| 59 var expectedArchiveVolume = { | 64 var expectedArchiveVolume = { |
| 60 volumeId: 'archive:archive_mount_path', | 65 volumeId: 'archive:archive_mount_path', |
| 61 volumeLabel: 'archive_mount_path', | 66 volumeLabel: 'archive_mount_path', |
| 62 sourcePath: /removable\/mount_path3\/archive.zip$/, | 67 sourcePath: /removable\/mount_path3\/archive.zip$/, |
| 63 volumeType: 'archive', | 68 volumeType: 'archive', |
| 64 isReadOnly: true, | 69 isReadOnly: true, |
| 70 hasMedia: false, |
| 65 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 71 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 66 }; | 72 }; |
| 67 | 73 |
| 68 // List of expected mount points. | 74 // List of expected mount points. |
| 69 // 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 |
| 70 // and values sorted by volumeId. | 76 // and values sorted by volumeId. |
| 71 var expectedVolumeList = [ | 77 var expectedVolumeList = [ |
| 72 expectedArchiveVolume, | 78 expectedArchiveVolume, |
| 73 expectedDownloadsVolume, | 79 expectedDownloadsVolume, |
| 74 expectedDriveVolume, | 80 expectedDriveVolume, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 'getMountPoints returned wrong number of mount points.'); | 133 'getMountPoints returned wrong number of mount points.'); |
| 128 for (var i = 0; i < expectedVolumeList.length; i++) { | 134 for (var i = 0; i < expectedVolumeList.length; i++) { |
| 129 chrome.test.assertTrue( | 135 chrome.test.assertTrue( |
| 130 validateObject( | 136 validateObject( |
| 131 result[i], expectedVolumeList[i], 'volumeMetadata'), | 137 result[i], expectedVolumeList[i], 'volumeMetadata'), |
| 132 'getMountPoints result[' + i + '] not as expected'); | 138 'getMountPoints result[' + i + '] not as expected'); |
| 133 } | 139 } |
| 134 })); | 140 })); |
| 135 } | 141 } |
| 136 ]); | 142 ]); |
| OLD | NEW |