Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: chrome/test/data/extensions/api_test/file_browser/mount_test/test.js

Issue 2451713002: Propagate the read_only_hardware flag of volumes to js. (Closed)
Patch Set: Rename the field name to is_read_only_removable_device, as it's only valid for removable devices. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 isReadOnlyRemovableDevice: false,
15 hasMedia: false, 16 hasMedia: false,
16 configurable: false, 17 configurable: false,
17 watchable: true, 18 watchable: true,
18 source: 'device', 19 source: 'device',
19 profile: {profileId: '', displayName: '', isCurrentProfile: true}, 20 profile: {profileId: '', displayName: '', isCurrentProfile: true},
20 }; 21 };
21 22
22 var expectedVolume2 = { 23 var expectedVolume2 = {
23 volumeId: 'removable:mount_path2', 24 volumeId: 'removable:mount_path2',
24 volumeLabel: 'mount_path2', 25 volumeLabel: 'mount_path2',
25 sourcePath: 'device_path2', 26 sourcePath: 'device_path2',
26 volumeType: 'removable', 27 volumeType: 'removable',
27 deviceType: 'mobile', 28 deviceType: 'mobile',
28 devicePath: 'system_path_prefix2', 29 devicePath: 'system_path_prefix2',
29 isParentDevice: true, 30 isParentDevice: true,
30 isReadOnly: true, 31 isReadOnly: true,
32 isReadOnlyRemovableDevice: true,
31 hasMedia: true, 33 hasMedia: true,
32 configurable: false, 34 configurable: false,
33 // This is not an MTP device, so it's watchable. 35 // This is not an MTP device, so it's watchable.
34 // TODO(mtomasz): Add a test for a real MTP device. 36 // TODO(mtomasz): Add a test for a real MTP device.
35 watchable: true, 37 watchable: true,
36 source: 'device', 38 source: 'device',
37 profile: {profileId: '', displayName: '', isCurrentProfile: true} 39 profile: {profileId: '', displayName: '', isCurrentProfile: true}
38 }; 40 };
39 41
40 var expectedVolume3 = { 42 var expectedVolume3 = {
41 volumeId: 'removable:mount_path3', 43 volumeId: 'removable:mount_path3',
42 volumeLabel: 'mount_path3', 44 volumeLabel: 'mount_path3',
43 sourcePath: 'device_path3', 45 sourcePath: 'device_path3',
44 volumeType: 'removable', 46 volumeType: 'removable',
45 deviceType: 'optical', 47 deviceType: 'optical',
46 devicePath: 'system_path_prefix3', 48 devicePath: 'system_path_prefix3',
47 isParentDevice: true, 49 isParentDevice: true,
48 isReadOnly: false, 50 isReadOnly: true,
51 isReadOnlyRemovableDevice: false,
49 hasMedia: false, 52 hasMedia: false,
50 configurable: false, 53 configurable: false,
51 watchable: true, 54 watchable: true,
52 source: 'device', 55 source: 'device',
53 profile: {profileId: '', displayName: '', isCurrentProfile: true} 56 profile: {profileId: '', displayName: '', isCurrentProfile: true}
54 }; 57 };
55 58
56 var expectedDownloadsVolume = { 59 var expectedDownloadsVolume = {
57 volumeId: /^downloads:Downloads[^\/]*$/, 60 volumeId: /^downloads:Downloads[^\/]*$/,
58 volumeLabel: '', 61 volumeLabel: '',
59 volumeType: 'downloads', 62 volumeType: 'downloads',
60 isReadOnly: false, 63 isReadOnly: false,
64 isReadOnlyRemovableDevice: false,
61 hasMedia: false, 65 hasMedia: false,
62 configurable: false, 66 configurable: false,
63 watchable: true, 67 watchable: true,
64 source: 'system', 68 source: 'system',
65 profile: {profileId: '', displayName: '', isCurrentProfile: true} 69 profile: {profileId: '', displayName: '', isCurrentProfile: true}
66 }; 70 };
67 71
68 var expectedDriveVolume = { 72 var expectedDriveVolume = {
69 volumeId: /^drive:drive[^\/]*$/, 73 volumeId: /^drive:drive[^\/]*$/,
70 volumeLabel: '', 74 volumeLabel: '',
71 sourcePath: /^\/special\/drive[^\/]*$/, 75 sourcePath: /^\/special\/drive[^\/]*$/,
72 volumeType: 'drive', 76 volumeType: 'drive',
73 isReadOnly: false, 77 isReadOnly: false,
78 isReadOnlyRemovableDevice: false,
74 hasMedia: false, 79 hasMedia: false,
75 configurable: false, 80 configurable: false,
76 watchable: true, 81 watchable: true,
77 source: 'network', 82 source: 'network',
78 profile: {profileId: '', displayName: '', isCurrentProfile: true} 83 profile: {profileId: '', displayName: '', isCurrentProfile: true}
79 }; 84 };
80 85
81 var expectedArchiveVolume = { 86 var expectedArchiveVolume = {
82 volumeId: 'archive:archive_mount_path', 87 volumeId: 'archive:archive_mount_path',
83 volumeLabel: 'archive_mount_path', 88 volumeLabel: 'archive_mount_path',
84 sourcePath: /removable\/mount_path3\/archive.zip$/, 89 sourcePath: /removable\/mount_path3\/archive.zip$/,
85 volumeType: 'archive', 90 volumeType: 'archive',
86 isReadOnly: true, 91 isReadOnly: true,
92 isReadOnlyRemovableDevice: false,
87 hasMedia: false, 93 hasMedia: false,
88 configurable: false, 94 configurable: false,
89 watchable: true, 95 watchable: true,
90 source: 'file', 96 source: 'file',
91 profile: {profileId: '', displayName: '', isCurrentProfile: true} 97 profile: {profileId: '', displayName: '', isCurrentProfile: true}
92 }; 98 };
93 99
94 var expectedProvidedVolume = { 100 var expectedProvidedVolume = {
95 volumeId: 'provided:', 101 volumeId: 'provided:',
96 volumeLabel: '', 102 volumeLabel: '',
97 volumeType: 'provided', 103 volumeType: 'provided',
98 isReadOnly: true, 104 isReadOnly: true,
105 isReadOnlyRemovableDevice: false,
99 hasMedia: false, 106 hasMedia: false,
100 configurable: true, 107 configurable: true,
101 watchable: false, 108 watchable: false,
102 extensionId: 'testing-extension-id', 109 extensionId: 'testing-extension-id',
103 source: 'network', 110 source: 'network',
104 mountContext: 'auto', 111 mountContext: 'auto',
105 fileSystemId: '', 112 fileSystemId: '',
106 profile: {profileId: '', displayName: '', isCurrentProfile: true} 113 profile: {profileId: '', displayName: '', isCurrentProfile: true}
107 }; 114 };
108 115
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 'getMountPoints returned wrong number of mount points.'); 176 'getMountPoints returned wrong number of mount points.');
170 for (var i = 0; i < expectedVolumeList.length; i++) { 177 for (var i = 0; i < expectedVolumeList.length; i++) {
171 chrome.test.assertTrue( 178 chrome.test.assertTrue(
172 validateObject( 179 validateObject(
173 result[i], expectedVolumeList[i], 'volumeMetadata'), 180 result[i], expectedVolumeList[i], 'volumeMetadata'),
174 'getMountPoints result[' + i + '] not as expected'); 181 'getMountPoints result[' + i + '] not as expected');
175 } 182 }
176 })); 183 }));
177 } 184 }
178 ]); 185 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/file_manager_private.idl ('k') | third_party/closure_compiler/externs/file_manager_private.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698