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

Unified Diff: chrome/browser/apps/app_browsertest.cc

Issue 224883008: Sniff MIME type for files which have unknown extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and omit binary file. Created 6 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
« no previous file with comments | « apps/launcher.cc ('k') | chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/app_browsertest.cc
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc
index c87b2bf6032dc50d500e66ecde0de7c1de5b6c61..34591b8416ad28c1c315595e5fae3caa17bdc7b5 100644
--- a/chrome/browser/apps/app_browsertest.cc
+++ b/chrome/browser/apps/app_browsertest.cc
@@ -652,10 +652,18 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithNoIntent) {
<< message_;
}
+// Tests that launch data is sent through when the file has unknown extension
+// but the MIME type can be sniffed and the sniffed type matches.
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithSniffableType) {
+ SetCommandLineArg("platform_apps/launch_files/test.unknownextension");
+ ASSERT_TRUE(RunPlatformAppTest(
+ "platform_apps/launch_file_by_extension_and_type")) << message_;
+}
+
// Tests that launch data is sent through with the MIME type set to
// application/octet-stream if the file MIME type cannot be read.
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoType) {
- SetCommandLineArg("platform_apps/launch_files/test.unknownextension");
+ SetCommandLineArg("platform_apps/launch_files/test_binary.unknownextension");
ASSERT_TRUE(RunPlatformAppTest(
"platform_apps/launch_application_octet_stream")) << message_;
}
« no previous file with comments | « apps/launcher.cc ('k') | chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698