OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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&, | 31 const WebKit::WebString&, |
30 const WebKit::WebString&) OVERRIDE; | 32 const WebKit::WebString&) OVERRIDE; |
31 | 33 |
32 private: | 34 private: |
33 bool IsSupportedMediaMimeType(const std::string& mime_type); | 35 bool IsBlacklistedMediaMimeType(const std::string& mime_type); |
34 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs); | 36 bool HasBlacklistedMediaCodecs(const std::vector<std::string>& codecs); |
35 | 37 |
36 typedef base::hash_set<std::string> MimeMappings; | 38 std::vector<std::string> blacklisted_media_types_; |
37 MimeMappings media_map_; | 39 std::vector<std::string> blacklisted_media_codecs_; |
38 MimeMappings codecs_map_; | |
39 | 40 |
40 DISALLOW_COPY_AND_ASSIGN(TestShellWebMimeRegistryImpl); | 41 DISALLOW_COPY_AND_ASSIGN(TestShellWebMimeRegistryImpl); |
41 }; | 42 }; |
42 | 43 |
43 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ | 44 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBMIMEREGISTRY_IMPL_H_ |
OLD | NEW |