Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: webkit/glue/mimetype_unittest.cc

Issue 18349: We should download text/csv mime types instead of displaying them.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/mime_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/base/mime_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698