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

Unified Diff: chrome/browser/web_applications/web_app_mac_unittest.mm

Issue 2621833003: Remove --enable-apps-file-associations flag. (Closed)
Patch Set: Created 3 years, 11 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: chrome/browser/web_applications/web_app_mac_unittest.mm
diff --git a/chrome/browser/web_applications/web_app_mac_unittest.mm b/chrome/browser/web_applications/web_app_mac_unittest.mm
index 562d933b0f2418ae3ef23d8654cd374a6e1acd37..f8f43dcc2d6029d13e185910e40ab46e545b3306 100644
--- a/chrome/browser/web_applications/web_app_mac_unittest.mm
+++ b/chrome/browser/web_applications/web_app_mac_unittest.mm
@@ -344,56 +344,4 @@ TEST_F(WebAppShortcutCreatorTest, RevealAppShimInFinder) {
SHORTCUT_CREATION_BY_USER, web_app::ShortcutLocations()));
}
-TEST_F(WebAppShortcutCreatorTest, FileHandlers) {
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableAppsFileAssociations);
- extensions::FileHandlersInfo file_handlers_info;
- extensions::FileHandlerInfo handler_0;
- handler_0.extensions.insert("ext0");
- handler_0.extensions.insert("ext1");
- handler_0.types.insert("type0");
- handler_0.types.insert("type1");
- file_handlers_info.push_back(handler_0);
- extensions::FileHandlerInfo handler_1;
- handler_1.extensions.insert("ext2");
- handler_1.types.insert("type2");
- file_handlers_info.push_back(handler_1);
-
- NiceMock<WebAppShortcutCreatorMock> shortcut_creator(
- app_data_dir_, info_.get(), file_handlers_info);
- EXPECT_CALL(shortcut_creator, GetApplicationsDirname())
- .WillRepeatedly(Return(destination_dir_));
- EXPECT_TRUE(shortcut_creator.CreateShortcuts(
- SHORTCUT_CREATION_AUTOMATED, web_app::ShortcutLocations()));
-
- base::FilePath plist_path =
- shim_path_.Append("Contents").Append("Info.plist");
- NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfFile:base::mac::FilePathToNSString(plist_path)];
- NSArray* file_handlers =
- [plist objectForKey:app_mode::kCFBundleDocumentTypesKey];
-
- NSDictionary* file_handler_0 = [file_handlers objectAtIndex:0];
- EXPECT_NSEQ(app_mode::kBundleTypeRoleViewer,
- [file_handler_0 objectForKey:app_mode::kCFBundleTypeRoleKey]);
- NSArray* file_handler_0_extensions =
- [file_handler_0 objectForKey:app_mode::kCFBundleTypeExtensionsKey];
- EXPECT_TRUE([file_handler_0_extensions containsObject:@"ext0"]);
- EXPECT_TRUE([file_handler_0_extensions containsObject:@"ext1"]);
- NSArray* file_handler_0_types =
- [file_handler_0 objectForKey:app_mode::kCFBundleTypeMIMETypesKey];
- EXPECT_TRUE([file_handler_0_types containsObject:@"type0"]);
- EXPECT_TRUE([file_handler_0_types containsObject:@"type1"]);
-
- NSDictionary* file_handler_1 = [file_handlers objectAtIndex:1];
- EXPECT_NSEQ(app_mode::kBundleTypeRoleViewer,
- [file_handler_1 objectForKey:app_mode::kCFBundleTypeRoleKey]);
- NSArray* file_handler_1_extensions =
- [file_handler_1 objectForKey:app_mode::kCFBundleTypeExtensionsKey];
- EXPECT_TRUE([file_handler_1_extensions containsObject:@"ext2"]);
- NSArray* file_handler_1_types =
- [file_handler_1 objectForKey:app_mode::kCFBundleTypeMIMETypesKey];
- EXPECT_TRUE([file_handler_1_types containsObject:@"type2"]);
-}
-
} // namespace web_app

Powered by Google App Engine
This is Rietveld 408576698