| 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 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 "http://example.com/foo.notarealext", "image/png", | 1907 "http://example.com/foo.notarealext", "image/png", |
| 1908 FILE_PATH_LITERAL(""), | 1908 FILE_PATH_LITERAL(""), |
| 1909 | 1909 |
| 1910 FILE_PATH_LITERAL("foo.notarealext"), | 1910 FILE_PATH_LITERAL("foo.notarealext"), |
| 1911 DownloadItem::TARGET_DISPOSITION_OVERWRITE, | 1911 DownloadItem::TARGET_DISPOSITION_OVERWRITE, |
| 1912 | 1912 |
| 1913 EXPECT_CRDOWNLOAD | 1913 EXPECT_CRDOWNLOAD |
| 1914 }, | 1914 }, |
| 1915 "" | 1915 "" |
| 1916 }, | 1916 }, |
| 1917 { |
| 1918 { |
| 1919 // 5: x-x509-user-cert mime-type. |
| 1920 AUTOMATIC, |
| 1921 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
| 1922 "http://example.com/foo.notarealext", "application/x-x509-user-cert", |
| 1923 FILE_PATH_LITERAL(""), |
| 1924 |
| 1925 FILE_PATH_LITERAL("user.crt"), |
| 1926 DownloadItem::TARGET_DISPOSITION_OVERWRITE, |
| 1927 |
| 1928 EXPECT_CRDOWNLOAD |
| 1929 }, |
| 1930 "" |
| 1931 }, |
| 1932 |
| 1917 }; | 1933 }; |
| 1918 | 1934 |
| 1919 ON_CALL(*delegate(), GetFileMimeType( | 1935 ON_CALL(*delegate(), GetFileMimeType( |
| 1920 GetPathInDownloadDir(FILE_PATH_LITERAL("foo.png")), _)) | 1936 GetPathInDownloadDir(FILE_PATH_LITERAL("foo.png")), _)) |
| 1921 .WillByDefault(WithArg<1>( | 1937 .WillByDefault(WithArg<1>( |
| 1922 ScheduleCallback("image/png"))); | 1938 ScheduleCallback("image/png"))); |
| 1923 | 1939 |
| 1924 for (size_t i = 0; i < arraysize(kMIMETypeTestCases); ++i) { | 1940 for (size_t i = 0; i < arraysize(kMIMETypeTestCases); ++i) { |
| 1925 SCOPED_TRACE(testing::Message() << "Running test case " << i); | 1941 SCOPED_TRACE(testing::Message() << "Running test case " << i); |
| 1926 const MIMETypeTestCase& test_case = kMIMETypeTestCases[i]; | 1942 const MIMETypeTestCase& test_case = kMIMETypeTestCases[i]; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path())) | 2260 EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path())) |
| 2245 .WillRepeatedly(Return(true)); | 2261 .WillRepeatedly(Return(true)); |
| 2246 | 2262 |
| 2247 target_info = RunDownloadTargetDeterminer( | 2263 target_info = RunDownloadTargetDeterminer( |
| 2248 GetPathInDownloadDir(kInitialPath), item.get()); | 2264 GetPathInDownloadDir(kInitialPath), item.get()); |
| 2249 EXPECT_FALSE(target_info->is_filetype_handled_safely); | 2265 EXPECT_FALSE(target_info->is_filetype_handled_safely); |
| 2250 } | 2266 } |
| 2251 #endif // defined(ENABLE_PLUGINS) | 2267 #endif // defined(ENABLE_PLUGINS) |
| 2252 | 2268 |
| 2253 } // namespace | 2269 } // namespace |
| OLD | NEW |