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

Side by Side Diff: ui/file_manager/file_manager/background/js/volume_manager_unittest.js

Issue 893913003: Files.app: Fix closure compiler error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 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
« no previous file with comments | « ui/file_manager/file_manager/background/js/volume_manager.js ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 var chrome; 5 var chrome;
6 6
7 loadTimeData.data = { 7 loadTimeData.data = {
8 DRIVE_DIRECTORY_LABEL: 'My Drive', 8 DRIVE_DIRECTORY_LABEL: 'My Drive',
9 DOWNLOADS_DIRECTORY_LABEL: 'Downloads' 9 DOWNLOADS_DIRECTORY_LABEL: 'Downloads'
10 }; 10 };
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 }), callback); 206 }), callback);
207 } 207 }
208 208
209 function testGetLocationInfo(callback) { 209 function testGetLocationInfo(callback) {
210 reportPromise(VolumeManager.getInstance().then(function(volumeManager) { 210 reportPromise(VolumeManager.getInstance().then(function(volumeManager) {
211 var downloadEntry = new MockFileEntry( 211 var downloadEntry = new MockFileEntry(
212 new MockFileSystem('download:Downloads'), 212 new MockFileSystem('download:Downloads'),
213 '/foo/bar/bla.zip'); 213 '/foo/bar/bla.zip');
214 var downloadLocationInfo = volumeManager.getLocationInfo(downloadEntry); 214 var downloadLocationInfo = volumeManager.getLocationInfo(downloadEntry);
215 assertEquals(VolumeManagerCommon.VolumeType.DOWNLOADS, 215 assertEquals(VolumeManagerCommon.VolumeType.DOWNLOADS,
216 downloadLocationInfo.rootType) 216 downloadLocationInfo.rootType);
217 assertFalse(downloadLocationInfo.isReadOnly); 217 assertFalse(downloadLocationInfo.isReadOnly);
218 assertFalse(downloadLocationInfo.isRootEntry); 218 assertFalse(downloadLocationInfo.isRootEntry);
219 219
220 var driveEntry = new MockFileEntry( 220 var driveEntry = new MockFileEntry(
221 new MockFileSystem('drive:drive-foobar%40chromium.org-hash'), 221 new MockFileSystem('drive:drive-foobar%40chromium.org-hash'),
222 '/root'); 222 '/root');
223 var driveLocationInfo = volumeManager.getLocationInfo(driveEntry); 223 var driveLocationInfo = volumeManager.getLocationInfo(driveEntry);
224 assertEquals(VolumeManagerCommon.VolumeType.DRIVE, 224 assertEquals(VolumeManagerCommon.VolumeType.DRIVE,
225 driveLocationInfo.rootType) 225 driveLocationInfo.rootType);
226 assertFalse(driveLocationInfo.isReadOnly); 226 assertFalse(driveLocationInfo.isReadOnly);
227 assertTrue(driveLocationInfo.isRootEntry); 227 assertTrue(driveLocationInfo.isRootEntry);
228 }), callback); 228 }), callback);
229 } 229 }
230
231 function testVolumeInfoListWhenReady(callback) {
232 var list = new VolumeInfoList();
233 var promiseBeforeAdd = list.whenVolumeInfoReady('volumeId');
234 var volumeInfo = new VolumeInfo(
235 /* volumeType */ null,
236 'volumeId',
237 /* fileSystem */ null,
238 /* error */ null,
239 /* deviceType */ null,
240 /* devicePath */ null,
241 /* isReadOnly */ false,
242 /* profile */ {},
243 /* label */ null,
244 /* extensionid */ null,
245 /* hasMedia */ false);
246 list.add(volumeInfo);
247 var promiseAfterAdd = list.whenVolumeInfoReady('volumeId');
248 reportPromise(Promise.all([promiseBeforeAdd, promiseAfterAdd]).then(
249 function(volumes) {
250 assertEquals(volumeInfo, volumes[0]);
251 assertEquals(volumeInfo, volumes[1]);
252 }), callback);
253 }
OLDNEW
« no previous file with comments | « ui/file_manager/file_manager/background/js/volume_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698