OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
13 #include "webkit/glue/simple_webmimeregistry_impl.h" | 13 #include "webkit/glue/simple_webmimeregistry_impl.h" |
14 | 14 |
15 class TestShellWebMimeRegistryImpl | 15 class TestShellWebMimeRegistryImpl |
16 : public webkit_glue::SimpleWebMimeRegistryImpl { | 16 : public webkit_glue::SimpleWebMimeRegistryImpl { |
17 public: | 17 public: |
18 TestShellWebMimeRegistryImpl(); | 18 TestShellWebMimeRegistryImpl(); |
19 virtual ~TestShellWebMimeRegistryImpl(); | 19 virtual ~TestShellWebMimeRegistryImpl(); |
20 | 20 |
21 // Override to force that we only support ogg, vorbis and theora. | 21 // Override to force that we only support types and codecs that are supported |
| 22 // by all variations of Chromium. |
22 // | 23 // |
23 // Media layout tests use canPlayType() to determine the test input files. | 24 // Media layout tests use canPlayType() to determine the test input files. |
24 // Different flavours of Chromium support different codecs, which has an | 25 // Different flavours of Chromium support different codecs, which has an |
25 // impact on how canPlayType() behaves. Since Chromium's baselines are | 26 // impact on how canPlayType() behaves. Since Chromium's baselines and |
26 // generated against ogg/vorbis/theora content we need to lock down how | 27 // expectations are generated against the common set of types, we need to |
27 // canPlayType() behaves when running layout tests. | 28 // prevent canPlayType() from indicating it supports other types when running |
| 29 // layout tests. |
28 virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( | 30 virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( |
29 const WebKit::WebString&, const WebKit::WebString&) OVERRIDE; | 31 const WebKit::WebString&, const WebKit::WebString&) OVERRIDE; |
30 | 32 |
31 private: | 33 private: |
32 bool IsSupportedMediaMimeType(const std::string& mime_type); | 34 bool IsBlacklistedMediaMimeType(const std::string& mime_type); |
33 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs); | 35 bool HasBlacklistedMediaCodecs(const std::vector<std::string>& codecs); |
34 | 36 |
35 typedef base::hash_set<std::string> MimeMappings; | 37 typedef base::hash_set<std::string> MimeMappings; |
36 MimeMappings media_map_; | 38 MimeMappings blacklisted_media_map_; |
37 MimeMappings codecs_map_; | 39 MimeMappings blacklisted_codecs_map_; |
38 | 40 |
39 DISALLOW_COPY_AND_ASSIGN(TestShellWebMimeRegistryImpl); | 41 DISALLOW_COPY_AND_ASSIGN(TestShellWebMimeRegistryImpl); |
40 }; | 42 }; |
41 | 43 |
42 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ | 44 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ |
OLD | NEW |