| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #undef LOG | 9 #undef LOG |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 std::wstring expected_src(L"<html>\n<body>\n" | 42 std::wstring expected_src(L"<html>\n<body>\n" |
| 43 L"<p>HTML text</p>\n</body>\n</html>\n"); | 43 L"<p>HTML text</p>\n</body>\n</html>\n"); |
| 44 | 44 |
| 45 // These files should all be displayed as plain text. | 45 // These files should all be displayed as plain text. |
| 46 const char* plain_text[] = { | 46 const char* plain_text[] = { |
| 47 // It is unclear whether to display text/css or download it. | 47 // It is unclear whether to display text/css or download it. |
| 48 // Firefox 3: Display | 48 // Firefox 3: Display |
| 49 // Internet Explorer 7: Download | 49 // Internet Explorer 7: Download |
| 50 // Safari 3.2: Download | 50 // Safari 3.2: Download |
| 51 // We choose to match Safari. | 51 // We choose to match Firefox due to the lot of complains |
| 52 // "text/css", | 52 // from the users if css files are downloaded: |
| 53 // http://code.google.com/p/chromium/issues/detail?id=7192 |
| 54 "text/css", |
| 53 "text/javascript", | 55 "text/javascript", |
| 54 "text/plain", | 56 "text/plain", |
| 55 "application/x-javascript", | 57 "application/x-javascript", |
| 56 }; | 58 }; |
| 57 for (size_t i = 0; i < arraysize(plain_text); ++i) { | 59 for (size_t i = 0; i < arraysize(plain_text); ++i) { |
| 58 CheckMimeType(plain_text[i], expected_src); | 60 CheckMimeType(plain_text[i], expected_src); |
| 59 } | 61 } |
| 60 | 62 |
| 61 // These should all be displayed as html content. | 63 // These should all be displayed as html content. |
| 62 const char* html_src[] = { | 64 const char* html_src[] = { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 81 CheckMimeType(not_text[i], L""); | 83 CheckMimeType(not_text[i], L""); |
| 82 test_shell_->webView()->StopLoading(); | 84 test_shell_->webView()->StopLoading(); |
| 83 } | 85 } |
| 84 | 86 |
| 85 // TODO(tc): make sure other mime types properly go to download (e.g., | 87 // TODO(tc): make sure other mime types properly go to download (e.g., |
| 86 // image/foo). | 88 // image/foo). |
| 87 | 89 |
| 88 } | 90 } |
| 89 | 91 |
| 90 } // namespace | 92 } // namespace |
| OLD | NEW |