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

Unified Diff: chrome/browser/media_galleries/media_file_system_registry_unittest.cc

Issue 164983006: Remove dead code in media galleries file system registry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retry upload 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media_galleries/media_file_system_registry.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/media_file_system_registry_unittest.cc
diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc
index 48df721f40f5f92b83be4729c585551c1a5b8d7d..dc65189a018d9444eb26683fc3abf9bea75c4ebf 100644
--- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc
+++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc
@@ -1046,3 +1046,32 @@ TEST_F(MediaFileSystemRegistryTest, TestNameConstruction) {
profile_state->CheckGalleries("names", one_expectation, one_expectation);
}
}
+
+TEST_F(MediaFileSystemRegistryTest, PreferenceListener) {
+ CreateProfileState(1);
+ AssertAllAutoAddedGalleries();
+
+ // Add a user gallery to the regular permission extension.
+ std::string device_id = AddUserGallery(StorageInfo::FIXED_MASS_STORAGE,
+ empty_dir().AsUTF8Unsafe(),
+ empty_dir());
+ ProfileState* profile_state = GetProfileState(0);
+ SetGalleryPermission(profile_state,
+ profile_state->regular_permission_extension(),
+ device_id,
+ true /*has access*/);
+
+ FSInfoMap fs_info = profile_state->GetGalleriesInfo(
+ profile_state->regular_permission_extension());
+ ASSERT_EQ(1U, fs_info.size());
+ EXPECT_FALSE(test_file_system_context()->GetPathForId(
+ fs_info.begin()->second.fsid).empty());
+
+ // Revoke permission and ensure that the file system is revoked.
+ SetGalleryPermission(profile_state,
+ profile_state->regular_permission_extension(),
+ device_id,
+ false /*has access*/);
+ EXPECT_TRUE(test_file_system_context()->GetPathForId(
+ fs_info.begin()->second.fsid).empty());
+}
« no previous file with comments | « chrome/browser/media_galleries/media_file_system_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698