| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 | 36 |
| 37 class MediaCapabilitiesTest : public ContentBrowserTest { | 37 class MediaCapabilitiesTest : public ContentBrowserTest { |
| 38 public: | 38 public: |
| 39 MediaCapabilitiesTest() = default; | 39 MediaCapabilitiesTest() = default; |
| 40 | 40 |
| 41 void SetUpCommandLine(base::CommandLine* command_line) override { | 41 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 42 command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, | 42 command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, |
| 43 "MediaCapabilities"); | 43 "MediaCapabilities"); |
| 44 command_line->AppendSwitch(switches::kEnableNewVp9CodecString); | |
| 45 } | 44 } |
| 46 | 45 |
| 47 std::string CanDecodeAudio(const std::string& content_type) { | 46 std::string CanDecodeAudio(const std::string& content_type) { |
| 48 return CanDecode(content_type, ConfigType::AUDIO); | 47 return CanDecode(content_type, ConfigType::AUDIO); |
| 49 } | 48 } |
| 50 | 49 |
| 51 std::string CanDecodeVideo(const std::string& content_type) { | 50 std::string CanDecodeVideo(const std::string& content_type) { |
| 52 return CanDecode(content_type, ConfigType::VIDEO); | 51 return CanDecode(content_type, ConfigType::VIDEO); |
| 53 } | 52 } |
| 54 | 53 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 EXPECT_EQ(kPropSupported, | 135 EXPECT_EQ(kPropSupported, |
| 137 CanDecodeAudio("'audio/mp4; codecs=\"mp4a.40.02\"'")); | 136 CanDecodeAudio("'audio/mp4; codecs=\"mp4a.40.02\"'")); |
| 138 EXPECT_EQ(kPropSupported, CanDecodeAudio("'audio/aac'")); | 137 EXPECT_EQ(kPropSupported, CanDecodeAudio("'audio/aac'")); |
| 139 | 138 |
| 140 // Test a handful of invalid strings. | 139 // Test a handful of invalid strings. |
| 141 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/wav; codecs=\"mp3\"'")); | 140 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/wav; codecs=\"mp3\"'")); |
| 142 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/webm; codecs=\"vp8\"'")); | 141 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/webm; codecs=\"vp8\"'")); |
| 143 } | 142 } |
| 144 | 143 |
| 145 } // namespace content | 144 } // namespace content |
| OLD | NEW |