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

Side by Side Diff: media/formats/mp4/dolby_vision_unittest.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « media/formats/mp4/dolby_vision.cc ('k') | media/formats/mp4/hevc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "media/formats/mp4/dolby_vision.h" 5 #include "media/formats/mp4/dolby_vision.h"
6 6
7 #include "media/base/video_codecs.h" 7 #include "media/base/video_codecs.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace media { 10 namespace media {
11 namespace mp4 { 11 namespace mp4 {
12 12
13 class DolbyVisionConfigurationTest : public testing::Test {}; 13 class DolbyVisionConfigurationTest : public testing::Test {};
14 14
15 TEST_F(DolbyVisionConfigurationTest, Profile0Level1ELTrackTest) { 15 TEST_F(DolbyVisionConfigurationTest, Profile0Level1ELTrackTest) {
16 DolbyVisionConfiguration dv_config; 16 DolbyVisionConfiguration dv_config;
17 uint8_t data[] = {0x00, 0x00, 0x00, 0x0E}; 17 uint8_t data[] = {0x00, 0x00, 0x00, 0x0E};
18 18
19 dv_config.Parse(data, sizeof(data)); 19 dv_config.ParseForTesting(data, sizeof(data));
20 20
21 EXPECT_EQ(dv_config.dv_version_major, 0); 21 EXPECT_EQ(dv_config.dv_version_major, 0);
22 EXPECT_EQ(dv_config.dv_version_minor, 0); 22 EXPECT_EQ(dv_config.dv_version_minor, 0);
23 EXPECT_EQ(dv_config.codec_profile, DOLBYVISION_PROFILE0); 23 EXPECT_EQ(dv_config.codec_profile, DOLBYVISION_PROFILE0);
24 EXPECT_EQ(dv_config.dv_level, 1); 24 EXPECT_EQ(dv_config.dv_level, 1);
25 EXPECT_EQ(dv_config.rpu_present_flag, 1); 25 EXPECT_EQ(dv_config.rpu_present_flag, 1);
26 EXPECT_EQ(dv_config.el_present_flag, 1); 26 EXPECT_EQ(dv_config.el_present_flag, 1);
27 EXPECT_EQ(dv_config.bl_present_flag, 0); 27 EXPECT_EQ(dv_config.bl_present_flag, 0);
28 } 28 }
29 29
30 TEST_F(DolbyVisionConfigurationTest, Profile4Level2ELTrackWithBLTest) { 30 TEST_F(DolbyVisionConfigurationTest, Profile4Level2ELTrackWithBLTest) {
31 DolbyVisionConfiguration dv_config; 31 DolbyVisionConfiguration dv_config;
32 uint8_t data[] = {0x00, 0x00, 0x08, 0x16}; 32 uint8_t data[] = {0x00, 0x00, 0x08, 0x16};
33 33
34 dv_config.Parse(data, sizeof(data)); 34 dv_config.ParseForTesting(data, sizeof(data));
35 35
36 EXPECT_EQ(dv_config.dv_version_major, 0); 36 EXPECT_EQ(dv_config.dv_version_major, 0);
37 EXPECT_EQ(dv_config.dv_version_minor, 0); 37 EXPECT_EQ(dv_config.dv_version_minor, 0);
38 EXPECT_EQ(dv_config.codec_profile, DOLBYVISION_PROFILE4); 38 EXPECT_EQ(dv_config.codec_profile, DOLBYVISION_PROFILE4);
39 EXPECT_EQ(dv_config.dv_level, 2); 39 EXPECT_EQ(dv_config.dv_level, 2);
40 EXPECT_EQ(dv_config.rpu_present_flag, 1); 40 EXPECT_EQ(dv_config.rpu_present_flag, 1);
41 EXPECT_EQ(dv_config.el_present_flag, 1); 41 EXPECT_EQ(dv_config.el_present_flag, 1);
42 EXPECT_EQ(dv_config.bl_present_flag, 0); 42 EXPECT_EQ(dv_config.bl_present_flag, 0);
43 } 43 }
44 44
45 TEST_F(DolbyVisionConfigurationTest, Profile5Test) { 45 TEST_F(DolbyVisionConfigurationTest, Profile5Test) {
46 DolbyVisionConfiguration dv_config; 46 DolbyVisionConfiguration dv_config;
47 uint8_t data[] = {0x00, 0x00, 0x0A, 0x17}; 47 uint8_t data[] = {0x00, 0x00, 0x0A, 0x17};
48 48
49 dv_config.Parse(data, sizeof(data)); 49 dv_config.ParseForTesting(data, sizeof(data));
50 50
51 EXPECT_EQ(dv_config.dv_version_major, 0); 51 EXPECT_EQ(dv_config.dv_version_major, 0);
52 EXPECT_EQ(dv_config.dv_version_minor, 0); 52 EXPECT_EQ(dv_config.dv_version_minor, 0);
53 EXPECT_EQ(dv_config.codec_profile, DOLBYVISION_PROFILE5); 53 EXPECT_EQ(dv_config.codec_profile, DOLBYVISION_PROFILE5);
54 EXPECT_EQ(dv_config.dv_level, 2); 54 EXPECT_EQ(dv_config.dv_level, 2);
55 EXPECT_EQ(dv_config.rpu_present_flag, 1); 55 EXPECT_EQ(dv_config.rpu_present_flag, 1);
56 EXPECT_EQ(dv_config.el_present_flag, 1); 56 EXPECT_EQ(dv_config.el_present_flag, 1);
57 EXPECT_EQ(dv_config.bl_present_flag, 1); 57 EXPECT_EQ(dv_config.bl_present_flag, 1);
58 } 58 }
59 59
60 TEST_F(DolbyVisionConfigurationTest, ParseNotEnoughData) { 60 TEST_F(DolbyVisionConfigurationTest, ParseNotEnoughData) {
61 DolbyVisionConfiguration dv_config; 61 DolbyVisionConfiguration dv_config;
62 uint8_t data[] = {0x00, 0x00, 0x0C}; 62 uint8_t data[] = {0x00, 0x00, 0x0C};
63 63
64 EXPECT_FALSE(dv_config.Parse(data, sizeof(data))); 64 EXPECT_FALSE(dv_config.ParseForTesting(data, sizeof(data)));
65 } 65 }
66 66
67 } // namespace mp4 67 } // namespace mp4
68 } // namespace media 68 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/dolby_vision.cc ('k') | media/formats/mp4/hevc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698