summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 00:08:05 +0000
committerdavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 00:08:05 +0000
commit91256e4f440f2588594359fe5e3ac78636448f1f (patch)
tree36aea606d0d000b8aee9c4f8f2f9889063fd6072
parenta461158cc5fb837f29ab8a4dbb76f68563761bf6 (diff)
downloadchromium_src-91256e4f440f2588594359fe5e3ac78636448f1f.zip
chromium_src-91256e4f440f2588594359fe5e3ac78636448f1f.tar.gz
chromium_src-91256e4f440f2588594359fe5e3ac78636448f1f.tar.bz2
plain/text is not a real MIME type.
Fix references to it to be 'text/plain'. Also one instance of 'plain/html'. BUG=none Review URL: https://codereview.chromium.org/178153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253646 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/streams_private/streams_private_apitest.cc18
-rw-r--r--chrome/browser/extensions/api/streams_private/streams_private_manifest_unittest.cc22
-rw-r--r--chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js8
-rw-r--r--chrome/test/data/extensions/api_test/streams_private/handle_mime_type/manifest.json2
-rw-r--r--content/browser/streams/stream_url_request_job.cc2
-rw-r--r--ppapi/examples/file_chooser/file_chooser.cc2
6 files changed, 27 insertions, 27 deletions
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
index c49dc7a..378b924 100644
--- a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
+++ b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
@@ -62,23 +62,23 @@ scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) {
}
// For relative path "/text_path_attch.txt", return success response with
- // MIME type "plain/text" and content "txt content". Also, set content
+ // MIME type "text/plain" and content "txt content". Also, set content
// disposition to be attachment.
if (request.relative_url == "/text_path_attch.txt") {
response->set_code(net::HTTP_OK);
response->set_content("txt content");
- response->set_content_type("plain/text");
+ response->set_content_type("text/plain");
response->AddCustomHeader("Content-Disposition",
"attachment; filename=test_path.txt");
return response.PassAs<HttpResponse>();
}
// For relative path "/test_path_attch.txt", return success response with
- // MIME type "plain/text" and content "txt content".
+ // MIME type "text/plain" and content "txt content".
if (request.relative_url == "/text_path.txt") {
response->set_code(net::HTTP_OK);
response->set_content("txt content");
- response->set_content_type("plain/text");
+ response->set_content_type("text/plain");
return response.PassAs<HttpResponse>();
}
@@ -106,7 +106,7 @@ scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) {
// StreamsResourceThrottle.
// The test extension expects the resources that should be handed to the
// extension to have MIME type 'application/msword' and the resources that
-// should be downloaded by the browser to have MIME type 'plain/text'.
+// should be downloaded by the browser to have MIME type 'text/plain'.
class StreamsPrivateApiTest : public ExtensionApiTest {
public:
StreamsPrivateApiTest() {}
@@ -168,10 +168,10 @@ class StreamsPrivateApiTest : public ExtensionApiTest {
}
// Loads the test extension and set's up its file_browser_handler to handle
- // 'application/msword' and 'plain/text' MIME types.
+ // 'application/msword' and 'text/plain' MIME types.
// The extension will notify success when it detects an event with the MIME
// type 'application/msword' and notify fail when it detects an event with the
- // MIME type 'plain/text'.
+ // MIME type 'text/plain'.
const extensions::Extension* LoadTestExtension() {
// The test extension id is set by the key value in the manifest.
test_extension_id_ = "oickdpebdnfbgkcaoklfcdhjniefkcji";
@@ -321,7 +321,7 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, NavigateToAnAttachment) {
// The test extension should not receive any events by now. Send it an event
// with MIME type "test/done", so it stops waiting for the events. (If there
- // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will
+ // was an event with MIME type 'text/plain', |catcher.GetNextResult()| will
// fail regardless of the sent event; chrome.test.notifySuccess will not be
// called by the extension).
SendDoneEvent();
@@ -373,7 +373,7 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, DirectDownload) {
// The test extension should not receive any events by now. Send it an event
// with MIME type "test/done", so it stops waiting for the events. (If there
- // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will
+ // was an event with MIME type 'text/plain', |catcher.GetNextResult()| will
// fail regardless of the sent event; chrome.test.notifySuccess will not be
// called by the extension).
SendDoneEvent();
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_manifest_unittest.cc b/chrome/browser/extensions/api/streams_private/streams_private_manifest_unittest.cc
index cb1e252..dfdf7d8 100644
--- a/chrome/browser/extensions/api/streams_private/streams_private_manifest_unittest.cc
+++ b/chrome/browser/extensions/api/streams_private/streams_private_manifest_unittest.cc
@@ -28,34 +28,34 @@ class StreamsPrivateManifestTest : public ExtensionManifestTest {
TEST_F(StreamsPrivateManifestTest, ValidMimeTypesHandlerMIMETypes) {
scoped_refptr<const Extension> extension =
ExtensionBuilder()
- .SetID(extension_misc::kQuickOfficeExtensionId)
- .SetManifest(DictionaryBuilder()
+ .SetID(extension_misc::kQuickOfficeExtensionId)
+ .SetManifest(
+ DictionaryBuilder()
.Set("name", "MIME type handler test")
.Set("version", "1.0.0")
.Set("manifest_version", 2)
- .Set("mime_types", ListBuilder()
- .Append("plain/text")))
- .Build();
+ .Set("mime_types", ListBuilder().Append("text/plain")))
+ .Build();
ASSERT_TRUE(extension.get());
MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension.get());
ASSERT_TRUE(handler != NULL);
- EXPECT_FALSE(handler->CanHandleMIMEType("plain/html"));
- EXPECT_TRUE(handler->CanHandleMIMEType("plain/text"));
+ EXPECT_FALSE(handler->CanHandleMIMEType("text/html"));
+ EXPECT_TRUE(handler->CanHandleMIMEType("text/plain"));
}
TEST_F(StreamsPrivateManifestTest,
MimeTypesHandlerMIMETypesNotWhitelisted) {
scoped_refptr<const Extension> extension =
ExtensionBuilder()
- .SetManifest(DictionaryBuilder()
+ .SetManifest(
+ DictionaryBuilder()
.Set("name", "MIME types test")
.Set("version", "1.0.0")
.Set("manifest_version", 2)
- .Set("mime_types", ListBuilder()
- .Append("plain/text")))
- .Build();
+ .Set("mime_types", ListBuilder().Append("text/plain")))
+ .Build();
ASSERT_TRUE(extension.get());
diff --git a/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js b/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
index a944906..b60b6c6 100644
--- a/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
+++ b/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/background.js
@@ -15,12 +15,12 @@ chrome.streamsPrivate.onExecuteMimeTypeHandler.addListener(
return;
}
- // The tests are setup so resources with MIME type 'plain/text' are meant to
+ // The tests are setup so resources with MIME type 'text/plain' are meant to
// be handled by the browser (i.e. downloaded). The extension getting event
- // with MIME type 'plain/text' is thus a failure.
- if (params.mimeType == 'plain/text') {
+ // with MIME type 'text/plain' is thus a failure.
+ if (params.mimeType == 'text/plain') {
chrome.test.notifyFail(
- 'Unexpected request to handle "plain/text" MIME type.');
+ 'Unexpected request to handle "text/plain" MIME type.');
// Set |hasFailed| so notifyPass doesn't get called later (when event with
// MIME type 'test/done' is received).
hasFailed = true;
diff --git a/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/manifest.json b/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/manifest.json
index 6dce5da..bc7758f 100644
--- a/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/manifest.json
+++ b/chrome/test/data/extensions/api_test/streams_private/handle_mime_type/manifest.json
@@ -8,7 +8,7 @@
},
"mime_types": [
"application/msword",
- "plain/text"
+ "text/plain"
],
"permissions": [
"streamsPrivate"
diff --git a/content/browser/streams/stream_url_request_job.cc b/content/browser/streams/stream_url_request_job.cc
index 09b9e6d..6d70eef 100644
--- a/content/browser/streams/stream_url_request_job.cc
+++ b/content/browser/streams/stream_url_request_job.cc
@@ -226,7 +226,7 @@ void StreamURLRequestJob::HeadersCompleted(net::HttpStatusCode status_code) {
if (status_code == net::HTTP_OK) {
std::string content_type_header(net::HttpRequestHeaders::kContentType);
content_type_header.append(": ");
- content_type_header.append("plain/text");
+ content_type_header.append("text/plain");
headers->AddHeader(content_type_header);
}
diff --git a/ppapi/examples/file_chooser/file_chooser.cc b/ppapi/examples/file_chooser/file_chooser.cc
index fd207fe..f220dd8 100644
--- a/ppapi/examples/file_chooser/file_chooser.cc
+++ b/ppapi/examples/file_chooser/file_chooser.cc
@@ -46,7 +46,7 @@ class MyInstance : public pp::InstancePrivate {
PP_FileChooserMode_Dev mode =
(multi_select ? PP_FILECHOOSERMODE_OPENMULTIPLE
: PP_FILECHOOSERMODE_OPEN);
- std::string accept_types = (multi_select ? "" : "plain/text");
+ std::string accept_types = (multi_select ? "" : "text/plain");
chooser_ = pp::FileChooser_Dev(this, mode, accept_types);
chooser_.Show(callback_factory_.NewCallbackWithOutput(