OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "media/mojo/services/mojo_renderer_impl.h" | 28 #include "media/mojo/services/mojo_renderer_impl.h" |
29 #include "mojo/application/public/cpp/application_impl.h" | 29 #include "mojo/application/public/cpp/application_impl.h" |
30 #include "mojo/application/public/cpp/application_test_base.h" | 30 #include "mojo/application/public/cpp/application_test_base.h" |
31 #include "mojo/application/public/cpp/connect.h" | 31 #include "mojo/application/public/cpp/connect.h" |
32 | 32 |
33 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way | 33 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way |
34 // currently to get hashes for video and audio samples. This also means that | 34 // currently to get hashes for video and audio samples. This also means that |
35 // real audio plays out for each test. | 35 // real audio plays out for each test. |
36 #define EXPECT_HASH_EQ(a, b) | 36 #define EXPECT_HASH_EQ(a, b) |
37 #define EXPECT_VIDEO_FORMAT_EQ(a, b) | 37 #define EXPECT_VIDEO_FORMAT_EQ(a, b) |
| 38 #define EXPECT_COLOR_SPACE_EQ(a, b) |
38 | 39 |
39 // TODO(xhwang): EME support is not complete for the mojo renderer, so all | 40 // TODO(xhwang): EME support is not complete for the mojo renderer, so all |
40 // encrypted tests are currently disabled. | 41 // encrypted tests are currently disabled. |
41 #define DISABLE_EME_TESTS 1 | 42 #define DISABLE_EME_TESTS 1 |
42 | 43 |
43 // TODO(xhwang,dalecurtis): Text tracks are not currently supported by the mojo | 44 // TODO(xhwang,dalecurtis): Text tracks are not currently supported by the mojo |
44 // renderer. | 45 // renderer. |
45 #define DISABLE_TEXT_TRACK_TESTS 1 | 46 #define DISABLE_TEXT_TRACK_TESTS 1 |
46 #else | 47 #else |
47 #define EXPECT_HASH_EQ(a, b) EXPECT_EQ(a, b) | 48 #define EXPECT_HASH_EQ(a, b) EXPECT_EQ(a, b) |
48 #define EXPECT_VIDEO_FORMAT_EQ(a, b) EXPECT_EQ(a, b) | 49 #define EXPECT_VIDEO_FORMAT_EQ(a, b) EXPECT_EQ(a, b) |
| 50 #define EXPECT_COLOR_SPACE_EQ(a, b) EXPECT_EQ(a, b) |
49 #endif | 51 #endif |
50 | 52 |
51 using testing::_; | 53 using testing::_; |
52 using testing::AnyNumber; | 54 using testing::AnyNumber; |
53 using testing::AtLeast; | 55 using testing::AtLeast; |
54 using testing::AtMost; | 56 using testing::AtMost; |
55 using testing::SaveArg; | 57 using testing::SaveArg; |
56 | 58 |
57 namespace media { | 59 namespace media { |
58 | 60 |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV24); | 1657 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV24); |
1656 } | 1658 } |
1657 | 1659 |
1658 // Verify that frames of VP9 video in the BT.709 color space have the YV12HD | 1660 // Verify that frames of VP9 video in the BT.709 color space have the YV12HD |
1659 // format. | 1661 // format. |
1660 TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) { | 1662 TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) { |
1661 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-bt709.webm")); | 1663 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-bt709.webm")); |
1662 Play(); | 1664 Play(); |
1663 ASSERT_TRUE(WaitUntilOnEnded()); | 1665 ASSERT_TRUE(WaitUntilOnEnded()); |
1664 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV12); | 1666 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, VideoFrame::YV12); |
1665 EXPECT_EQ(last_video_frame_color_space_, VideoFrame::COLOR_SPACE_HD_REC709); | 1667 EXPECT_COLOR_SPACE_EQ(last_video_frame_color_space_, |
| 1668 VideoFrame::COLOR_SPACE_HD_REC709); |
1666 } | 1669 } |
1667 | 1670 |
1668 // Verify that videos with an odd frame size playback successfully. | 1671 // Verify that videos with an odd frame size playback successfully. |
1669 TEST_F(PipelineIntegrationTest, BasicPlayback_OddVideoSize) { | 1672 TEST_F(PipelineIntegrationTest, BasicPlayback_OddVideoSize) { |
1670 ASSERT_EQ(PIPELINE_OK, Start("butterfly-853x480.webm")); | 1673 ASSERT_EQ(PIPELINE_OK, Start("butterfly-853x480.webm")); |
1671 Play(); | 1674 Play(); |
1672 ASSERT_TRUE(WaitUntilOnEnded()); | 1675 ASSERT_TRUE(WaitUntilOnEnded()); |
1673 } | 1676 } |
1674 | 1677 |
1675 // Verify that OPUS audio in a webm which reports a 44.1kHz sample rate plays | 1678 // Verify that OPUS audio in a webm which reports a 44.1kHz sample rate plays |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 | 1743 |
1741 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 1744 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
1742 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 1745 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
1743 Play(); | 1746 Play(); |
1744 ASSERT_TRUE(WaitUntilOnEnded()); | 1747 ASSERT_TRUE(WaitUntilOnEnded()); |
1745 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 1748 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
1746 demuxer_->GetStartTime()); | 1749 demuxer_->GetStartTime()); |
1747 } | 1750 } |
1748 | 1751 |
1749 } // namespace media | 1752 } // namespace media |
OLD | NEW |