| 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 "content/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 private: | 245 private: |
| 246 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderTest); | 246 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderTest); |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 const int RTCVideoDecoderTest::kWidth = 640; | 249 const int RTCVideoDecoderTest::kWidth = 640; |
| 250 const int RTCVideoDecoderTest::kHeight = 480; | 250 const int RTCVideoDecoderTest::kHeight = 480; |
| 251 const PipelineStatistics RTCVideoDecoderTest::kStatistics; | 251 const PipelineStatistics RTCVideoDecoderTest::kStatistics; |
| 252 | 252 |
| 253 MATCHER_P2(HasSize, width, height, "") { | 253 MATCHER_P2(HasSize, width, height, "") { |
| 254 EXPECT_EQ(arg->data_size().width(), width); | 254 EXPECT_EQ(arg->coded_size().width(), width); |
| 255 EXPECT_EQ(arg->data_size().height(), height); | 255 EXPECT_EQ(arg->coded_size().height(), height); |
| 256 EXPECT_EQ(arg->visible_rect().x(), 0); |
| 257 EXPECT_EQ(arg->visible_rect().y(), 0); |
| 258 EXPECT_EQ(arg->visible_rect().width(), width); |
| 259 EXPECT_EQ(arg->visible_rect().height(), height); |
| 256 EXPECT_EQ(arg->natural_size().width(), width); | 260 EXPECT_EQ(arg->natural_size().width(), width); |
| 257 EXPECT_EQ(arg->natural_size().height(), height); | 261 EXPECT_EQ(arg->natural_size().height(), height); |
| 258 return (arg->data_size().width() == width) && | 262 return (arg->coded_size().width() == width) && |
| 259 (arg->data_size().height() == height) && | 263 (arg->coded_size().height() == height) && |
| 264 (arg->visible_rect().x() == 0) && |
| 265 (arg->visible_rect().y() == 0) && |
| 266 (arg->visible_rect().width() == width) && |
| 267 (arg->visible_rect().height() == height) && |
| 260 (arg->natural_size().width() == width) && | 268 (arg->natural_size().width() == width) && |
| 261 (arg->natural_size().height() == height); | 269 (arg->natural_size().height() == height); |
| 262 } | 270 } |
| 263 | 271 |
| 264 TEST_F(RTCVideoDecoderTest, Initialize_Successful) { | 272 TEST_F(RTCVideoDecoderTest, Initialize_Successful) { |
| 265 InitializeDecoderSuccessfully(); | 273 InitializeDecoderSuccessfully(); |
| 266 | 274 |
| 267 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, | 275 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, |
| 268 HasSize(kWidth, kHeight))); | 276 HasSize(kWidth, kHeight))); |
| 269 decoder_->Read(read_cb_); | 277 decoder_->Read(read_cb_); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 Stop(); | 331 Stop(); |
| 324 | 332 |
| 325 // Any read after stopping should be immediately satisfied. | 333 // Any read after stopping should be immediately satisfied. |
| 326 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, | 334 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, |
| 327 scoped_refptr<media::VideoFrame>())); | 335 scoped_refptr<media::VideoFrame>())); |
| 328 decoder_->Read(read_cb_); | 336 decoder_->Read(read_cb_); |
| 329 message_loop_.RunAllPending(); | 337 message_loop_.RunAllPending(); |
| 330 } | 338 } |
| 331 | 339 |
| 332 } // namespace content | 340 } // namespace content |
| OLD | NEW |