OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains download browser tests that are known to be runnable | 5 // This file contains download browser tests that are known to be runnable |
6 // in a pure content context. Over time tests should be migrated here. | 6 // in a pure content context. Over time tests should be migrated here. |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 const base::FilePath::CharType kTestFilePath[] = | 847 const base::FilePath::CharType kTestFilePath[] = |
848 FILE_PATH_LITERAL("octet-stream.abc"); | 848 FILE_PATH_LITERAL("octet-stream.abc"); |
849 const char kTestPluginName[] = "TestPlugin"; | 849 const char kTestPluginName[] = "TestPlugin"; |
850 const char kTestMimeType[] = "application/x-test-mime-type"; | 850 const char kTestMimeType[] = "application/x-test-mime-type"; |
851 const char kTestFileType[] = "abc"; | 851 const char kTestFileType[] = "abc"; |
852 | 852 |
853 WebPluginInfo plugin_info; | 853 WebPluginInfo plugin_info; |
854 plugin_info.name = base::ASCIIToUTF16(kTestPluginName); | 854 plugin_info.name = base::ASCIIToUTF16(kTestPluginName); |
855 plugin_info.mime_types.push_back( | 855 plugin_info.mime_types.push_back( |
856 WebPluginMimeType(kTestMimeType, kTestFileType, "")); | 856 WebPluginMimeType(kTestMimeType, kTestFileType, "")); |
| 857 plugin_info.type = WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; |
857 PluginServiceImpl::GetInstance()->RegisterInternalPlugin(plugin_info, false); | 858 PluginServiceImpl::GetInstance()->RegisterInternalPlugin(plugin_info, false); |
858 | 859 |
859 // The following is served with a Content-Type of application/octet-stream. | 860 // The following is served with a Content-Type of application/octet-stream. |
860 GURL url( | 861 GURL url( |
861 net::URLRequestMockHTTPJob::GetMockUrl(base::FilePath(kTestFilePath))); | 862 net::URLRequestMockHTTPJob::GetMockUrl(base::FilePath(kTestFilePath))); |
862 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); | 863 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); |
863 } | 864 } |
864 #endif | 865 #endif |
865 | 866 |
866 // Try to cancel just before we release the download file, by delaying final | 867 // Try to cancel just before we release the download file, by delaying final |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 ASSERT_TRUE(test_server.InitializeAndWaitUntilReady()); | 1811 ASSERT_TRUE(test_server.InitializeAndWaitUntilReady()); |
1811 | 1812 |
1812 GURL url = test_server.GetURL("/empty.bin"); | 1813 GURL url = test_server.GetURL("/empty.bin"); |
1813 test_server.ServeFilesFromDirectory(GetTestFilePath("download", "")); | 1814 test_server.ServeFilesFromDirectory(GetTestFilePath("download", "")); |
1814 | 1815 |
1815 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); | 1816 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); |
1816 // That's it. This should work without crashing. | 1817 // That's it. This should work without crashing. |
1817 } | 1818 } |
1818 | 1819 |
1819 } // namespace content | 1820 } // namespace content |
OLD | NEW |