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

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

Issue 160483004: Keep track of the list of currently mounted volumes in C++-side VolumeManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/file_manager/volume_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 mountPath: '/removable/mount_path1', 8 mountPath: '/removable/mount_path1',
9 sourcePath: 'device_path1', 9 sourcePath: 'device_path1',
10 volumeType: 'removable', 10 volumeType: 'removable',
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 volumeId: 'archive:archive_mount_path', 63 volumeId: 'archive:archive_mount_path',
64 mountPath: '/archive/archive_mount_path', 64 mountPath: '/archive/archive_mount_path',
65 sourcePath: 'archive_path', 65 sourcePath: 'archive_path',
66 volumeType: 'archive', 66 volumeType: 'archive',
67 isReadOnly: true, 67 isReadOnly: true,
68 profile: {profileId: "", displayName: "", isCurrentProfile: true} 68 profile: {profileId: "", displayName: "", isCurrentProfile: true}
69 }; 69 };
70 70
71 // List of expected mount points. 71 // List of expected mount points.
72 // NOTE: this has to be synced with values in file_browser_private_apitest.cc 72 // NOTE: this has to be synced with values in file_browser_private_apitest.cc
73 // and values sorted by mountPath. 73 // and values sorted by volumeId.
74 var expectedVolumeList = [ 74 var expectedVolumeList = [
75 expectedArchiveVolume,
76 expectedDownloadsVolume,
75 expectedDriveVolume, 77 expectedDriveVolume,
76 expectedDownloadsVolume,
77 expectedArchiveVolume,
78 expectedVolume1, 78 expectedVolume1,
79 expectedVolume2, 79 expectedVolume2,
80 expectedVolume3, 80 expectedVolume3,
81 ]; 81 ];
82 82
83 function validateObject(received, expected, name) { 83 function validateObject(received, expected, name) {
84 for (var key in expected) { 84 for (var key in expected) {
85 if (expected[key] instanceof RegExp) { 85 if (expected[key] instanceof RegExp) {
86 if (!expected[key].test(received[key])) { 86 if (!expected[key].test(received[key])) {
87 console.warn('Expected "' + key + '" ' + name + ' property to match: ' + 87 console.warn('Expected "' + key + '" ' + name + ' property to match: ' +
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 chrome.fileBrowserPrivate.removeMount('archive:archive_mount_path'); 119 chrome.fileBrowserPrivate.removeMount('archive:archive_mount_path');
120 120
121 // We actually check this one on C++ side. If MountLibrary.RemoveMount 121 // We actually check this one on C++ side. If MountLibrary.RemoveMount
122 // doesn't get called, test will fail. 122 // doesn't get called, test will fail.
123 chrome.test.succeed(); 123 chrome.test.succeed();
124 }, 124 },
125 125
126 function getVolumeMetadataList() { 126 function getVolumeMetadataList() {
127 chrome.fileBrowserPrivate.getVolumeMetadataList( 127 chrome.fileBrowserPrivate.getVolumeMetadataList(
128 chrome.test.callbackPass(function(result) { 128 chrome.test.callbackPass(function(result) {
129 chrome.test.assertEq(result.length, expectedVolumeList.length, 129 chrome.test.assertEq(expectedVolumeList.length, result.length,
130 'getMountPoints returned wrong number of mount points.'); 130 'getMountPoints returned wrong number of mount points.');
131 for (var i = 0; i < expectedVolumeList.length; i++) { 131 for (var i = 0; i < expectedVolumeList.length; i++) {
132 chrome.test.assertTrue( 132 chrome.test.assertTrue(
133 validateObject( 133 validateObject(
134 result[i], expectedVolumeList[i], 'volumeMetadata'), 134 result[i], expectedVolumeList[i], 'volumeMetadata'),
135 'getMountPoints result[' + i + '] not as expected'); 135 'getMountPoints result[' + i + '] not as expected');
136 } 136 }
137 })); 137 }));
138 } 138 }
139 ]); 139 ]);
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/volume_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698