| 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 volumeLabel: 'drive_label1', | 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 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 volumeLabel: 'drive_label2', | 20 volumeLabel: 'mount_path2', |
| 21 sourcePath: 'device_path2', | 21 sourcePath: 'device_path2', |
| 22 volumeType: 'removable', | 22 volumeType: 'removable', |
| 23 deviceType: 'mobile', | 23 deviceType: 'mobile', |
| 24 devicePath: 'system_path_prefix2', | 24 devicePath: 'system_path_prefix2', |
| 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 volumeLabel: 'drive_label3', | 32 volumeLabel: 'mount_path3', |
| 33 sourcePath: 'device_path3', | 33 sourcePath: 'device_path3', |
| 34 volumeType: 'removable', | 34 volumeType: 'removable', |
| 35 deviceType: 'optical', | 35 deviceType: 'optical', |
| 36 devicePath: 'system_path_prefix3', | 36 devicePath: 'system_path_prefix3', |
| 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 volumeLabel: '', | 44 volumeLabel: '', |
| 45 volumeType: 'downloads', | 45 volumeType: 'downloads', |
| 46 isReadOnly: false, | 46 isReadOnly: false, |
| 47 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 47 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 var expectedDriveVolume = { | 50 var expectedDriveVolume = { |
| 51 volumeId: /^drive:drive[^\/]*$/, | 51 volumeId: /^drive:drive[^\/]*$/, |
| 52 volumeLabel: '', | 52 volumeLabel: '', |
| 53 sourcePath: /^\/special\/drive[^\/]*$/, | 53 sourcePath: /^\/special\/drive[^\/]*$/, |
| 54 volumeType: 'drive', | 54 volumeType: 'drive', |
| 55 isReadOnly: false, | 55 isReadOnly: false, |
| 56 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 56 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 var expectedArchiveVolume = { | 59 var expectedArchiveVolume = { |
| 60 volumeId: 'archive:archive_mount_path', | 60 volumeId: 'archive:archive_mount_path', |
| 61 volumeLabel: '', | 61 volumeLabel: 'archive_mount_path', |
| 62 sourcePath: /removable\/mount_path3\/archive.zip$/, | 62 sourcePath: /removable\/mount_path3\/archive.zip$/, |
| 63 volumeType: 'archive', | 63 volumeType: 'archive', |
| 64 isReadOnly: true, | 64 isReadOnly: true, |
| 65 profile: {profileId: "", displayName: "", isCurrentProfile: true} | 65 profile: {profileId: "", displayName: "", isCurrentProfile: true} |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // List of expected mount points. | 68 // List of expected mount points. |
| 69 // NOTE: this has to be synced with values in file_browser_private_apitest.cc | 69 // NOTE: this has to be synced with values in file_browser_private_apitest.cc |
| 70 // and values sorted by volumeId. | 70 // and values sorted by volumeId. |
| 71 var expectedVolumeList = [ | 71 var expectedVolumeList = [ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 'getMountPoints returned wrong number of mount points.'); | 127 'getMountPoints returned wrong number of mount points.'); |
| 128 for (var i = 0; i < expectedVolumeList.length; i++) { | 128 for (var i = 0; i < expectedVolumeList.length; i++) { |
| 129 chrome.test.assertTrue( | 129 chrome.test.assertTrue( |
| 130 validateObject( | 130 validateObject( |
| 131 result[i], expectedVolumeList[i], 'volumeMetadata'), | 131 result[i], expectedVolumeList[i], 'volumeMetadata'), |
| 132 'getMountPoints result[' + i + '] not as expected'); | 132 'getMountPoints result[' + i + '] not as expected'); |
| 133 } | 133 } |
| 134 })); | 134 })); |
| 135 } | 135 } |
| 136 ]); | 136 ]); |
| OLD | NEW |