| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/base/buffers.h" | 5 #include "media/base/buffers.h" |
| 6 #include "media/base/mock_media_filters.h" | 6 #include "media/base/mock_media_filters.h" |
| 7 #include "media/base/video_frame_impl.h" | 7 #include "media/base/video_frame_impl.h" |
| 8 #include "media/base/yuv_convert.h" | 8 #include "media/base/yuv_convert.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 // Test StreamSample implementation. | 85 // Test StreamSample implementation. |
| 86 EXPECT_TRUE(kTimestampA == frame->GetTimestamp()); | 86 EXPECT_TRUE(kTimestampA == frame->GetTimestamp()); |
| 87 EXPECT_TRUE(kDurationA == frame->GetDuration()); | 87 EXPECT_TRUE(kDurationA == frame->GetDuration()); |
| 88 EXPECT_FALSE(frame->IsEndOfStream()); | 88 EXPECT_FALSE(frame->IsEndOfStream()); |
| 89 EXPECT_FALSE(frame->IsDiscontinuous()); | 89 EXPECT_FALSE(frame->IsDiscontinuous()); |
| 90 frame->SetTimestamp(kTimestampB); | 90 frame->SetTimestamp(kTimestampB); |
| 91 frame->SetDuration(kDurationB); | 91 frame->SetDuration(kDurationB); |
| 92 EXPECT_TRUE(kTimestampB == frame->GetTimestamp()); | 92 EXPECT_TRUE(kTimestampB == frame->GetTimestamp()); |
| 93 EXPECT_TRUE(kDurationB == frame->GetDuration()); | 93 EXPECT_TRUE(kDurationB == frame->GetDuration()); |
| 94 frame->SetEndOfStream(true); | |
| 95 EXPECT_TRUE(frame->IsEndOfStream()); | |
| 96 frame->SetEndOfStream(false); | |
| 97 EXPECT_FALSE(frame->IsEndOfStream()); | 94 EXPECT_FALSE(frame->IsEndOfStream()); |
| 98 frame->SetDiscontinuous(true); | 95 frame->SetDiscontinuous(true); |
| 99 EXPECT_TRUE(frame->IsDiscontinuous()); | 96 EXPECT_TRUE(frame->IsDiscontinuous()); |
| 100 frame->SetDiscontinuous(false); | 97 frame->SetDiscontinuous(false); |
| 101 EXPECT_FALSE(frame->IsDiscontinuous()); | 98 EXPECT_FALSE(frame->IsDiscontinuous()); |
| 102 | 99 |
| 103 // Test VideoFrame implementation. | 100 // Test VideoFrame implementation. |
| 104 media::MockVideoDecoder::InitializeYV12Frame(frame, 0.0f); | 101 media::MockVideoDecoder::InitializeYV12Frame(frame, 0.0f); |
| 105 ExpectFrameColor(frame, 0xFF000000); | 102 ExpectFrameColor(frame, 0xFF000000); |
| 106 media::MockVideoDecoder::InitializeYV12Frame(frame, 1.0f); | 103 media::MockVideoDecoder::InitializeYV12Frame(frame, 1.0f); |
| 107 ExpectFrameColor(frame, 0xFFFFFFFF); | 104 ExpectFrameColor(frame, 0xFFFFFFFF); |
| 105 |
| 106 // Test an empty frame. |
| 107 media::VideoFrameImpl::CreateEmptyFrame(&frame); |
| 108 EXPECT_TRUE(frame->IsEndOfStream()); |
| 108 } | 109 } |
| OLD | NEW |