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 "base/strings/string_split.h" | 5 #include "base/strings/string_split.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "net/base/mime_util.h" | 8 #include "net/base/mime_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 const base::FilePath::StringType extension; | 21 const base::FilePath::StringType extension; |
22 const char* const mime_type; | 22 const char* const mime_type; |
23 bool valid; | 23 bool valid; |
24 } tests[] = { | 24 } tests[] = { |
25 {FILE_PATH_LITERAL("png"), "image/png", true}, | 25 {FILE_PATH_LITERAL("png"), "image/png", true}, |
26 {FILE_PATH_LITERAL("PNG"), "image/png", true}, | 26 {FILE_PATH_LITERAL("PNG"), "image/png", true}, |
27 {FILE_PATH_LITERAL("css"), "text/css", true}, | 27 {FILE_PATH_LITERAL("css"), "text/css", true}, |
28 {FILE_PATH_LITERAL("pjp"), "image/jpeg", true}, | 28 {FILE_PATH_LITERAL("pjp"), "image/jpeg", true}, |
29 {FILE_PATH_LITERAL("pjpeg"), "image/jpeg", true}, | 29 {FILE_PATH_LITERAL("pjpeg"), "image/jpeg", true}, |
30 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
31 // These two are test cases for testing platform mime types on Chrome OS. | 31 // These three are test cases for testing platform mime types on Chrome OS. |
32 {FILE_PATH_LITERAL("epub"), "application/epub+zip", true}, | 32 {FILE_PATH_LITERAL("epub"), "application/epub+zip", true}, |
33 {FILE_PATH_LITERAL("ics"), "text/calendar", true}, | 33 {FILE_PATH_LITERAL("ics"), "text/calendar", true}, |
34 {FILE_PATH_LITERAL("apk"), "application/vnd.android.package-archive", true}, | |
asanka
2016/11/16 14:51:45
Might as well add .zip here as well.
kinaba
2016/11/17 00:16:07
Done.
| |
34 #endif | 35 #endif |
35 #if defined(OS_ANDROID) | 36 #if defined(OS_ANDROID) |
36 {FILE_PATH_LITERAL("m3u8"), "application/x-mpegurl", true}, | 37 {FILE_PATH_LITERAL("m3u8"), "application/x-mpegurl", true}, |
37 #endif | 38 #endif |
38 {FILE_PATH_LITERAL("not an extension / for sure"), "", false}, | 39 {FILE_PATH_LITERAL("not an extension / for sure"), "", false}, |
39 {containsNullByte, "", false} | 40 {containsNullByte, "", false} |
40 }; | 41 }; |
41 | 42 |
42 std::string mime_type; | 43 std::string mime_type; |
43 bool rv; | 44 bool rv; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 std::string post_data; | 314 std::string post_data; |
314 AddMultipartValueForUpload("value name", "value", "boundary", | 315 AddMultipartValueForUpload("value name", "value", "boundary", |
315 "content type", &post_data); | 316 "content type", &post_data); |
316 AddMultipartValueForUpload("value name", "value", "boundary", | 317 AddMultipartValueForUpload("value name", "value", "boundary", |
317 "", &post_data); | 318 "", &post_data); |
318 AddMultipartFinalDelimiterForUpload("boundary", &post_data); | 319 AddMultipartFinalDelimiterForUpload("boundary", &post_data); |
319 EXPECT_STREQ(ref_output, post_data.c_str()); | 320 EXPECT_STREQ(ref_output, post_data.c_str()); |
320 } | 321 } |
321 | 322 |
322 } // namespace net | 323 } // namespace net |
OLD | NEW |