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