summaryrefslogtreecommitdiffstats
path: root/webkit/glue/simple_webmimeregistry_impl.cc
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-26 22:08:03 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-26 22:08:03 +0000
commitd56a89cca85b9607ca2e4e37efc8b2eb71ab8dd2 (patch)
tree6b76df353af8fffb7c52acfddb93960d33a748b0 /webkit/glue/simple_webmimeregistry_impl.cc
parent10baea924c51ef80c02d95009cab728b38feb03c (diff)
downloadchromium_src-d56a89cca85b9607ca2e4e37efc8b2eb71ab8dd2.zip
chromium_src-d56a89cca85b9607ca2e4e37efc8b2eb71ab8dd2.tar.gz
chromium_src-d56a89cca85b9607ca2e4e37efc8b2eb71ab8dd2.tar.bz2
Override SimpleWebMimeRegistryImpl::supportsMediaMIMEType() for test_shell.
Different versions of Chromium support different codecs, which results in all media layout tests failing since they are generated against ogg/vorbis/theora content. By overriding supportsMediaMIMEType() all media layout tests will use ogg/vorbis/theora test input. BUG=25886 TEST=test_shell on offical builder should start passing media layout tests Review URL: http://codereview.chromium.org/1356003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/simple_webmimeregistry_impl.cc')
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index ce5c94e..f12f48b 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -17,7 +17,7 @@ namespace {
// Convert a WebString to ASCII, falling back on an empty string in the case
// of a non-ASCII string.
-std::string AsASCII(const WebString& string) {
+std::string ToASCIIOrEmpty(const WebString& string) {
if (!IsStringASCII(string))
return std::string();
return UTF16ToASCII(string);
@@ -29,21 +29,21 @@ namespace webkit_glue {
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedMimeType(ToASCIIOrEmpty(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsImageMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedImageMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedImageMimeType(ToASCIIOrEmpty(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedJavascriptMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedJavascriptMimeType(ToASCIIOrEmpty(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
@@ -51,12 +51,12 @@ WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsJavaScriptMIMET
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
const WebString& mime_type, const WebString& codecs) {
// Not supporting the container is a flat-out no.
- if (!net::IsSupportedMediaMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedMediaMimeType(ToASCIIOrEmpty(mime_type).c_str()))
return IsNotSupported;
// If we don't recognize the codec, it's possible we support it.
std::vector<std::string> parsed_codecs;
- net::ParseCodecString(AsASCII(codecs).c_str(), &parsed_codecs);
+ net::ParseCodecString(ToASCIIOrEmpty(codecs).c_str(), &parsed_codecs);
if (!net::AreSupportedMediaCodecs(parsed_codecs))
return MayBeSupported;
@@ -66,7 +66,7 @@ WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsNonImageMIMEType(
const WebString& mime_type) {
- if (!net::IsSupportedNonImageMimeType(AsASCII(mime_type).c_str()))
+ if (!net::IsSupportedNonImageMimeType(ToASCIIOrEmpty(mime_type).c_str()))
return WebMimeRegistry::IsNotSupported;
return WebMimeRegistry::IsSupported;
}
@@ -90,7 +90,7 @@ WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile(
WebString SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType(
const WebString& mime_type) {
FilePath::StringType file_extension;
- net::GetPreferredExtensionForMimeType(AsASCII(mime_type),
+ net::GetPreferredExtensionForMimeType(ToASCIIOrEmpty(mime_type),
&file_extension);
return FilePathStringToWebString(file_extension);
}