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

Side by Side Diff: trunk/src/chrome/browser/apps/app_browsertest.cc

Issue 240313002: Revert 264167 "Sniff MIME type for files which have unknown exte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "apps/app_window.h" 5 #include "apps/app_window.h"
6 #include "apps/app_window_registry.h" 6 #include "apps/app_window_registry.h"
7 #include "apps/common/api/app_runtime.h" 7 #include "apps/common/api/app_runtime.h"
8 #include "apps/launcher.h" 8 #include "apps/launcher.h"
9 #include "apps/ui/native_app_window.h" 9 #include "apps/ui/native_app_window.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 646
647 // Tests that no launch data is sent through if the platform app does not 647 // Tests that no launch data is sent through if the platform app does not
648 // provide an intent. 648 // provide an intent.
649 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithNoIntent) { 649 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithNoIntent) {
650 SetCommandLineArg(kTestFilePath); 650 SetCommandLineArg(kTestFilePath);
651 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_no_intent")) 651 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_no_intent"))
652 << message_; 652 << message_;
653 } 653 }
654 654
655 // Tests that launch data is sent through when the file has unknown extension
656 // but the MIME type can be sniffed and the sniffed type matches.
657 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithSniffableType) {
658 SetCommandLineArg("platform_apps/launch_files/test.unknownextension");
659 ASSERT_TRUE(RunPlatformAppTest(
660 "platform_apps/launch_file_by_extension_and_type")) << message_;
661 }
662
663 // Tests that launch data is sent through with the MIME type set to 655 // Tests that launch data is sent through with the MIME type set to
664 // application/octet-stream if the file MIME type cannot be read. 656 // application/octet-stream if the file MIME type cannot be read.
665 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoType) { 657 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoType) {
666 SetCommandLineArg("platform_apps/launch_files/test_binary.unknownextension"); 658 SetCommandLineArg("platform_apps/launch_files/test.unknownextension");
667 ASSERT_TRUE(RunPlatformAppTest( 659 ASSERT_TRUE(RunPlatformAppTest(
668 "platform_apps/launch_application_octet_stream")) << message_; 660 "platform_apps/launch_application_octet_stream")) << message_;
669 } 661 }
670 662
671 // Tests that no launch data is sent through if the file does not exist. 663 // Tests that no launch data is sent through if the file does not exist.
672 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoFile) { 664 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoFile) {
673 SetCommandLineArg("platform_apps/launch_files/doesnotexist.txt"); 665 SetCommandLineArg("platform_apps/launch_files/doesnotexist.txt");
674 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_invalid")) 666 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_invalid"))
675 << message_; 667 << message_;
676 } 668 }
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 1324
1333 ExtensionApiTest::ResultCatcher result_catcher; 1325 ExtensionApiTest::ResultCatcher result_catcher;
1334 1326
1335 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); 1327 ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
1336 1328
1337 EXPECT_TRUE(result_catcher.GetNextResult()); 1329 EXPECT_TRUE(result_catcher.GetNextResult());
1338 } 1330 }
1339 } 1331 }
1340 1332
1341 } // namespace extensions 1333 } // namespace extensions
OLDNEW
« no previous file with comments | « trunk/src/apps/launcher.cc ('k') | trunk/src/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