| 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 24 matching lines...) Expand all Loading... |
| 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); | 44 command_line->AppendSwitch(switches::kEnableNewVp9CodecString); |
| 45 command_line->AppendSwitch(switches::kEnableVp9InMp4); | |
| 46 } | 45 } |
| 47 | 46 |
| 48 std::string CanDecodeAudio(const std::string& content_type) { | 47 std::string CanDecodeAudio(const std::string& content_type) { |
| 49 return CanDecode(content_type, ConfigType::AUDIO); | 48 return CanDecode(content_type, ConfigType::AUDIO); |
| 50 } | 49 } |
| 51 | 50 |
| 52 std::string CanDecodeVideo(const std::string& content_type) { | 51 std::string CanDecodeVideo(const std::string& content_type) { |
| 53 return CanDecode(content_type, ConfigType::VIDEO); | 52 return CanDecode(content_type, ConfigType::VIDEO); |
| 54 } | 53 } |
| 55 | 54 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 96 |
| 98 // Supported when built with USE_PROPRIETARY_CODECS | 97 // Supported when built with USE_PROPRIETARY_CODECS |
| 99 EXPECT_EQ(kPropSupported, | 98 EXPECT_EQ(kPropSupported, |
| 100 CanDecodeVideo("'video/mp4; codecs=\"avc1.42E01E\"'")); | 99 CanDecodeVideo("'video/mp4; codecs=\"avc1.42E01E\"'")); |
| 101 EXPECT_EQ(kPropSupported, | 100 EXPECT_EQ(kPropSupported, |
| 102 CanDecodeVideo("'video/mp4; codecs=\"avc1.42101E\"'")); | 101 CanDecodeVideo("'video/mp4; codecs=\"avc1.42101E\"'")); |
| 103 EXPECT_EQ(kPropSupported, | 102 EXPECT_EQ(kPropSupported, |
| 104 CanDecodeVideo("'video/mp4; codecs=\"avc1.42701E\"'")); | 103 CanDecodeVideo("'video/mp4; codecs=\"avc1.42701E\"'")); |
| 105 EXPECT_EQ(kPropSupported, | 104 EXPECT_EQ(kPropSupported, |
| 106 CanDecodeVideo("'video/mp4; codecs=\"avc1.42F01E\"'")); | 105 CanDecodeVideo("'video/mp4; codecs=\"avc1.42F01E\"'")); |
| 107 // Requires command line flag switches::kEnableVp9InMp4 | |
| 108 EXPECT_EQ(kPropSupported, | 106 EXPECT_EQ(kPropSupported, |
| 109 CanDecodeVideo("'video/mp4; codecs=\"vp09.00.10.08\"'")); | 107 CanDecodeVideo("'video/mp4; codecs=\"vp09.00.10.08\"'")); |
| 110 | 108 |
| 111 // Test a handful of invalid strings. | 109 // Test a handful of invalid strings. |
| 112 EXPECT_EQ(kUnsupported, CanDecodeVideo("'video/webm; codecs=\"theora\"'")); | 110 EXPECT_EQ(kUnsupported, CanDecodeVideo("'video/webm; codecs=\"theora\"'")); |
| 113 EXPECT_EQ(kUnsupported, | 111 EXPECT_EQ(kUnsupported, |
| 114 CanDecodeVideo("'video/webm; codecs=\"avc1.42E01E\"'")); | 112 CanDecodeVideo("'video/webm; codecs=\"avc1.42E01E\"'")); |
| 115 // Only new vp09 format is supported with MP4. | 113 // Only new vp09 format is supported with MP4. |
| 116 EXPECT_EQ(kUnsupported, CanDecodeVideo("'video/mp4; codecs=\"vp9\"'")); | 114 EXPECT_EQ(kUnsupported, CanDecodeVideo("'video/mp4; codecs=\"vp9\"'")); |
| 117 } | 115 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 138 EXPECT_EQ(kPropSupported, | 136 EXPECT_EQ(kPropSupported, |
| 139 CanDecodeAudio("'audio/mp4; codecs=\"mp4a.40.02\"'")); | 137 CanDecodeAudio("'audio/mp4; codecs=\"mp4a.40.02\"'")); |
| 140 EXPECT_EQ(kPropSupported, CanDecodeAudio("'audio/aac'")); | 138 EXPECT_EQ(kPropSupported, CanDecodeAudio("'audio/aac'")); |
| 141 | 139 |
| 142 // Test a handful of invalid strings. | 140 // Test a handful of invalid strings. |
| 143 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/wav; codecs=\"mp3\"'")); | 141 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/wav; codecs=\"mp3\"'")); |
| 144 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/webm; codecs=\"vp8\"'")); | 142 EXPECT_EQ(kUnsupported, CanDecodeAudio("'audio/webm; codecs=\"vp8\"'")); |
| 145 } | 143 } |
| 146 | 144 |
| 147 } // namespace content | 145 } // namespace content |
| OLD | NEW |