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

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

Issue 23658009: Replace mountType by volumeType on fileBrowserPrivate APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
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 devicePath: 'device_path1', 7 devicePath: 'device_path1',
8 mountPath: 'removable/mount_path1', 8 mountPath: 'removable/mount_path1',
9 systemPath: 'system_path1', 9 systemPath: 'system_path1',
10 filePath: 'file_path1', 10 filePath: 'file_path1',
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 mountPath: 'Downloads', 52 mountPath: 'Downloads',
53 isReadOnly: false, 53 isReadOnly: false,
54 }; 54 };
55 55
56 // List of expected mount points. 56 // List of expected mount points.
57 // NOTE: this has to be synced with values in file_browser_private_apitest.cc 57 // NOTE: this has to be synced with values in file_browser_private_apitest.cc
58 // and values sorted by mountPath. 58 // and values sorted by mountPath.
59 var expectedMountPoints = [ 59 var expectedMountPoints = [
60 { 60 {
61 mountPath: 'Downloads', 61 mountPath: 'Downloads',
62 volumeType: 'downloads',
62 mountCondition: '' 63 mountCondition: ''
63 }, 64 },
64 { 65 {
65 sourcePath: 'archive_path', 66 sourcePath: 'archive_path',
66 mountPath: 'archive/archive_mount_path', 67 mountPath: 'archive/archive_mount_path',
67 mountType: 'file', 68 volumeType: 'archive',
68 mountCondition: '' 69 mountCondition: ''
69 }, 70 },
70 { 71 {
71 sourcePath: 'device_path1', 72 sourcePath: 'device_path1',
72 mountPath: 'removable/mount_path1', 73 mountPath: 'removable/mount_path1',
73 mountType: 'device', 74 volumeType: 'removable',
74 mountCondition: '' 75 mountCondition: ''
75 }, 76 },
76 { 77 {
77 sourcePath: 'device_path2', 78 sourcePath: 'device_path2',
78 mountPath: 'removable/mount_path2', 79 mountPath: 'removable/mount_path2',
79 mountType: 'device', 80 volumeType: 'removable',
80 mountCondition: '' 81 mountCondition: ''
81 }, 82 },
82 { 83 {
83 sourcePath: 'device_path3', 84 sourcePath: 'device_path3',
84 mountPath: 'removable/mount_path3', 85 mountPath: 'removable/mount_path3',
85 mountType: 'device', 86 volumeType: 'removable',
86 mountCondition: '' 87 mountCondition: ''
87 } 88 }
88 ]; 89 ];
89 90
90 function validateObject(received, expected, name) { 91 function validateObject(received, expected, name) {
91 for (var key in expected) { 92 for (var key in expected) {
92 if (received[key] != expected[key]) { 93 if (received[key] != expected[key]) {
93 console.warn('Expected "' + key + '" ' + name + ' property to be: "' + 94 console.warn('Expected "' + key + '" ' + name + ' property to be: "' +
94 expected[key] + '"' + ', but got: "' + received[key] + 95 expected[key] + '"' + ', but got: "' + received[key] +
95 '" instead.'); 96 '" instead.');
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 chrome.test.assertEq(result.length, expectedMountPoints.length, 191 chrome.test.assertEq(result.length, expectedMountPoints.length,
191 'getMountPoints returned wrong number of mount points.'); 192 'getMountPoints returned wrong number of mount points.');
192 for (var i = 0; i < expectedMountPoints.length; i++) { 193 for (var i = 0; i < expectedMountPoints.length; i++) {
193 chrome.test.assertTrue( 194 chrome.test.assertTrue(
194 validateObject(result[i], expectedMountPoints[i], 'mountPoint'), 195 validateObject(result[i], expectedMountPoints[i], 'mountPoint'),
195 'getMountPoints result[' + i + '] not as expected'); 196 'getMountPoints result[' + i + '] not as expected');
196 } 197 }
197 })); 198 }));
198 } 199 }
199 ]); 200 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698