Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: content/browser/media/media_canplaytype_browsertest.cc

Issue 816353010: Implemented HEVC video demuxing and parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added hevc handling in media/base/android/media_codec_bridge.cc Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/media/media_canplaytype_browsertest.cc
diff --git a/content/browser/media/media_canplaytype_browsertest.cc b/content/browser/media/media_canplaytype_browsertest.cc
index b44a3a1f752a71eb1916f6e7d20322aa81c55a92..724e0ba726b9e8500ea8605c0133eb27dc41ca2c 100644
--- a/content/browser/media/media_canplaytype_browsertest.cc
+++ b/content/browser/media/media_canplaytype_browsertest.cc
@@ -173,6 +173,19 @@ class MediaCanPlayTypeTest : public MediaBrowserTest {
EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"mp4ax\"'"));
EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"unknown\"'"));
+
+ // Don't allow incomplete/ambiguous codec ids for HEVC for now.
ddorwin 2015/03/25 01:21:59 Remove " for now".
servolk 2015/03/25 02:20:20 Done.
+ // Codec string must have info about codec level/profile, e.g. hvc1.1.L0.0
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hev1\"'"));
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hvc1\"'"));
ddorwin 2015/03/25 01:21:59 Also test these with a trailing dot. And valid com
servolk 2015/03/25 02:20:20 Done.
+
+ // Invalid codecs that look like something similar to HEVC/H.265
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hev1x\"'"));
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hvc1x\"'"));
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hvc0.1.L0.0\"'"));
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hev0.1.L0.0\"'"));
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hvc2.1.L0.0\"'"));
+ EXPECT_EQ(kNot, CanPlay("'" + mime + "; codecs=\"hev2.1.L0.0\"'"));
}
void TestOGGUnacceptableCombinations(const std::string& mime) {
@@ -568,6 +581,19 @@ IN_PROC_BROWSER_TEST_F(MediaCanPlayTypeTest, CodecSupportTest_mp4) {
EXPECT_EQ(kNot, CanPlay("'audio/x-m4a; codecs=\"avc3.64001F\"'"));
TestMPEGUnacceptableCombinations("audio/x-m4a");
+
+ const char* kHevcSupported = kNot;
+#if defined(ENABLE_HEVC_DEMUXING)
+ kHevcSupported = kPropProbably;
ddorwin 2015/03/25 01:21:59 Why not just #if/#else?
servolk 2015/03/25 02:20:20 Something like: #if defined(ENABLE_HEVC_DEMUXING)
ddorwin 2015/03/25 18:02:58 Because immediately changing the value looks weird
servolk 2015/04/29 23:50:32 Done.
ddorwin 2015/06/12 00:52:26 It doesn't look like this was fully addressed. Add
+#endif
+ // TODO(servolk): Add more unit test coverage once we have more info about
ddorwin 2015/03/25 01:21:59 Detailed tests of the codec strings probably belon
servolk 2015/03/25 02:20:20 Yes, but that's going to be done when we actually
ddorwin 2015/03/25 18:02:58 I was just saying that the tests wouldn't be at th
servolk 2015/04/29 23:50:32 I think this whole test could use some refactoring
ddorwin 2015/06/12 00:52:26 It is verbose, and that is intentional. We have a
+ // various HEVC levels/profiles.
+ EXPECT_EQ(kHevcSupported, CanPlay("'video/mp4; codecs=\"hvc1.1.L0.0\"'"));
ddorwin 2015/03/25 01:21:59 You are testing video/mp4 far away from the other
servolk 2015/03/25 02:20:20 Done (except HLS; HEVC is not supported via HLS at
ddorwin 2015/03/25 18:02:58 Then you should have negative tests.
servolk 2015/04/29 23:50:32 Done.
ddorwin 2015/06/12 00:52:26 It doesn't look like this was done. Added comments
+ EXPECT_EQ(kHevcSupported, CanPlay("'video/mp4; codecs=\"hev1.1.L0.0\"'"));
+ EXPECT_EQ(kHevcSupported,
+ CanPlay("'video/mp4; codecs=\"hvc1.1.L0.0, mp4a.40.5\"'"));
+ EXPECT_EQ(kHevcSupported,
+ CanPlay("'video/mp4; codecs=\"hev1.1.L0.0, mp4a.40.5\"'"));
}
// When modifying this test, also change CodecSupportTest_Avc3Variants.

Powered by Google App Engine
This is Rietveld 408576698