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