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

Unified Diff: ui/file_manager/file_manager/background/js/volume_manager_unittest.js

Issue 2839863002: Add Team Drive subtree to the directory list view. (Closed)
Patch Set: Fix FileManagerJsTest.{NavigationListModelTest,ProvidersModel}. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/background/js/volume_manager_unittest.js
diff --git a/ui/file_manager/file_manager/background/js/volume_manager_unittest.js b/ui/file_manager/file_manager/background/js/volume_manager_unittest.js
index 0dd7f71dd3448009d49f2a5737717c5fc98a728b..9664b3f3a166e93665259c66e200610b78604d20 100644
--- a/ui/file_manager/file_manager/background/js/volume_manager_unittest.js
+++ b/ui/file_manager/file_manager/background/js/volume_manager_unittest.js
@@ -79,6 +79,7 @@ function setUp() {
}
}
};
+ new MockCommandLinePrivate();
chrome.fileManagerPrivate.mountSourcePath_ = null;
chrome.fileManagerPrivate.onMountCompletedListeners_ = [];
@@ -247,6 +248,7 @@ function testGetLocationInfo(callback) {
var downloadLocationInfo = volumeManager.getLocationInfo(downloadEntry);
assertEquals(VolumeManagerCommon.RootType.DOWNLOADS,
downloadLocationInfo.rootType);
+ assertFalse(downloadLocationInfo.hasFixedLabel);
assertFalse(downloadLocationInfo.isReadOnly);
assertFalse(downloadLocationInfo.isRootEntry);
@@ -256,8 +258,32 @@ function testGetLocationInfo(callback) {
var driveLocationInfo = volumeManager.getLocationInfo(driveEntry);
assertEquals(VolumeManagerCommon.RootType.DRIVE,
driveLocationInfo.rootType);
+ assertTrue(driveLocationInfo.hasFixedLabel);
assertFalse(driveLocationInfo.isReadOnly);
assertTrue(driveLocationInfo.isRootEntry);
+
+ var teamDrivesGrandRoot = new MockFileEntry(
+ new MockFileSystem('drive:drive-foobar%40chromium.org-hash'),
+ '/team_drives');
+ var teamDrivesGrandRootLocationInfo =
+ volumeManager.getLocationInfo(teamDrivesGrandRoot);
+ assertEquals(
+ VolumeManagerCommon.RootType.TEAM_DRIVES,
+ teamDrivesGrandRootLocationInfo.rootType);
+ assertTrue(teamDrivesGrandRootLocationInfo.hasFixedLabel);
+ assertTrue(teamDrivesGrandRootLocationInfo.isReadOnly);
+ assertTrue(teamDrivesGrandRootLocationInfo.isRootEntry);
+
+ var teamDrive = new MockFileEntry(
+ new MockFileSystem('drive:drive-foobar%40chromium.org-hash'),
+ '/team_drives/MyTeamDrive');
+ var teamDriveLocationInfo = volumeManager.getLocationInfo(teamDrive);
+ assertEquals(
+ VolumeManagerCommon.RootType.TEAM_DRIVES,
+ teamDriveLocationInfo.rootType);
+ assertFalse(teamDriveLocationInfo.hasFixedLabel);
+ assertFalse(teamDriveLocationInfo.isReadOnly);
+ assertTrue(teamDriveLocationInfo.isRootEntry);
}),
callback);
}

Powered by Google App Engine
This is Rietveld 408576698