| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 TEST_F(MimeTypeTests, MimeTypeTests) { | 38 TEST_F(MimeTypeTests, MimeTypeTests) { |
| 39 server_ = UnittestTestServer::CreateServer(); | 39 server_ = UnittestTestServer::CreateServer(); |
| 40 ASSERT_TRUE(NULL != server_.get()); | 40 ASSERT_TRUE(NULL != server_.get()); |
| 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 "text/css", | 47 // It is unclear whether to display text/css or download it. |
| 48 "text/foo", | 48 // Firefox 3: Display |
| 49 "text/richext", | 49 // Internet Explorer 7: Download |
| 50 "text/rtf", | 50 // Safari 3.2: Download |
| 51 // We choose to match Safari. |
| 52 // "text/css", |
| 53 "text/javascript", |
| 54 "text/plain", |
| 51 "application/x-javascript", | 55 "application/x-javascript", |
| 52 }; | 56 }; |
| 53 for (size_t i = 0; i < arraysize(plain_text); ++i) { | 57 for (size_t i = 0; i < arraysize(plain_text); ++i) { |
| 54 CheckMimeType(plain_text[i], expected_src); | 58 CheckMimeType(plain_text[i], expected_src); |
| 55 } | 59 } |
| 56 | 60 |
| 57 // These should all be displayed as html content. | 61 // These should all be displayed as html content. |
| 58 const char* html_src[] = { | 62 const char* html_src[] = { |
| 59 "text/html", | 63 "text/html", |
| 60 "text/xml", | 64 "text/xml", |
| (...skipping 17 matching lines...) Expand all Loading... |
| 78 test_shell_->webView()->StopLoading(); | 82 test_shell_->webView()->StopLoading(); |
| 79 } | 83 } |
| 80 | 84 |
| 81 // TODO(tc): make sure other mime types properly go to download (e.g., | 85 // TODO(tc): make sure other mime types properly go to download (e.g., |
| 82 // image/foo). | 86 // image/foo). |
| 83 | 87 |
| 84 } | 88 } |
| 85 | 89 |
| 86 } // namespace | 90 } // namespace |
| 87 | 91 |
| OLD | NEW |