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

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

Issue 1055183003: Add a data source field for volumes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a typo. Created 5 years, 8 months 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 volumeSource: 'device',
10 volumeType: 'removable', 11 volumeType: 'removable',
11 deviceType: 'usb', 12 deviceType: 'usb',
12 devicePath: 'system_path_prefix1', 13 devicePath: 'system_path_prefix1',
13 isParentDevice: false, 14 isParentDevice: false,
14 isReadOnly: false, 15 isReadOnly: false,
15 hasMedia: false, 16 hasMedia: false,
16 profile: {profileId: "", displayName: "", isCurrentProfile: true} 17 profile: {profileId: "", displayName: "", isCurrentProfile: true}
17 }; 18 };
18 19
19 var expectedVolume2 = { 20 var expectedVolume2 = {
20 volumeId: 'removable:mount_path2', 21 volumeId: 'removable:mount_path2',
21 volumeLabel: 'mount_path2', 22 volumeLabel: 'mount_path2',
22 sourcePath: 'device_path2', 23 sourcePath: 'device_path2',
24 volumeSource: 'device',
23 volumeType: 'removable', 25 volumeType: 'removable',
24 deviceType: 'mobile', 26 deviceType: 'mobile',
25 devicePath: 'system_path_prefix2', 27 devicePath: 'system_path_prefix2',
26 isParentDevice: true, 28 isParentDevice: true,
27 isReadOnly: true, 29 isReadOnly: true,
28 hasMedia: true, 30 hasMedia: true,
29 profile: {profileId: "", displayName: "", isCurrentProfile: true} 31 profile: {profileId: "", displayName: "", isCurrentProfile: true}
30 }; 32 };
31 33
32 var expectedVolume3 = { 34 var expectedVolume3 = {
33 volumeId: 'removable:mount_path3', 35 volumeId: 'removable:mount_path3',
34 volumeLabel: 'mount_path3', 36 volumeLabel: 'mount_path3',
35 sourcePath: 'device_path3', 37 sourcePath: 'device_path3',
38 volumeSource: 'device',
36 volumeType: 'removable', 39 volumeType: 'removable',
37 deviceType: 'optical', 40 deviceType: 'optical',
38 devicePath: 'system_path_prefix3', 41 devicePath: 'system_path_prefix3',
39 isParentDevice: true, 42 isParentDevice: true,
40 isReadOnly: false, 43 isReadOnly: false,
41 hasMedia: false, 44 hasMedia: false,
42 profile: {profileId: "", displayName: "", isCurrentProfile: true} 45 profile: {profileId: "", displayName: "", isCurrentProfile: true}
43 }; 46 };
44 47
45 var expectedDownloadsVolume = { 48 var expectedDownloadsVolume = {
46 volumeId: /^downloads:Downloads[^\/]*$/, 49 volumeId: /^downloads:Downloads[^\/]*$/,
47 volumeLabel: '', 50 volumeLabel: '',
51 volumeSource: 'device',
48 volumeType: 'downloads', 52 volumeType: 'downloads',
49 isReadOnly: false, 53 isReadOnly: false,
50 hasMedia: false, 54 hasMedia: false,
51 profile: {profileId: "", displayName: "", isCurrentProfile: true} 55 profile: {profileId: "", displayName: "", isCurrentProfile: true}
52 }; 56 };
53 57
54 var expectedDriveVolume = { 58 var expectedDriveVolume = {
55 volumeId: /^drive:drive[^\/]*$/, 59 volumeId: /^drive:drive[^\/]*$/,
56 volumeLabel: '', 60 volumeLabel: '',
57 sourcePath: /^\/special\/drive[^\/]*$/, 61 sourcePath: /^\/special\/drive[^\/]*$/,
62 volumeSource: 'network',
58 volumeType: 'drive', 63 volumeType: 'drive',
59 isReadOnly: false, 64 isReadOnly: false,
60 hasMedia: false, 65 hasMedia: false,
61 profile: {profileId: "", displayName: "", isCurrentProfile: true} 66 profile: {profileId: "", displayName: "", isCurrentProfile: true}
62 }; 67 };
63 68
64 var expectedArchiveVolume = { 69 var expectedArchiveVolume = {
65 volumeId: 'archive:archive_mount_path', 70 volumeId: 'archive:archive_mount_path',
66 volumeLabel: 'archive_mount_path', 71 volumeLabel: 'archive_mount_path',
67 sourcePath: /removable\/mount_path3\/archive.zip$/, 72 sourcePath: /removable\/mount_path3\/archive.zip$/,
73 volumeSource: 'file',
68 volumeType: 'archive', 74 volumeType: 'archive',
69 isReadOnly: true, 75 isReadOnly: true,
70 hasMedia: false, 76 hasMedia: false,
71 profile: {profileId: "", displayName: "", isCurrentProfile: true} 77 profile: {profileId: "", displayName: "", isCurrentProfile: true}
72 }; 78 };
73 79
74 // List of expected mount points. 80 // List of expected mount points.
75 // NOTE: this has to be synced with values in file_manager_private_apitest.cc 81 // NOTE: this has to be synced with values in file_manager_private_apitest.cc
76 // and values sorted by volumeId. 82 // and values sorted by volumeId.
77 var expectedVolumeList = [ 83 var expectedVolumeList = [
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 'getMountPoints returned wrong number of mount points.'); 139 'getMountPoints returned wrong number of mount points.');
134 for (var i = 0; i < expectedVolumeList.length; i++) { 140 for (var i = 0; i < expectedVolumeList.length; i++) {
135 chrome.test.assertTrue( 141 chrome.test.assertTrue(
136 validateObject( 142 validateObject(
137 result[i], expectedVolumeList[i], 'volumeMetadata'), 143 result[i], expectedVolumeList[i], 'volumeMetadata'),
138 'getMountPoints result[' + i + '] not as expected'); 144 'getMountPoints result[' + i + '] not as expected');
139 } 145 }
140 })); 146 }));
141 } 147 }
142 ]); 148 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698