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

Side by Side Diff: media/filters/decrypting_demuxer_stream_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/filters/decrypting_demuxer_stream.cc ('k') | media/filters/decrypting_video_decoder.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 (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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 arg0.Run(buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); 55 arg0.Run(buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer);
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 class DecryptingDemuxerStreamTest : public testing::Test { 60 class DecryptingDemuxerStreamTest : public testing::Test {
61 public: 61 public:
62 DecryptingDemuxerStreamTest() 62 DecryptingDemuxerStreamTest()
63 : demuxer_stream_(new DecryptingDemuxerStream( 63 : demuxer_stream_(new DecryptingDemuxerStream(
64 message_loop_.task_runner(), 64 message_loop_.task_runner(),
65 new MediaLog(), 65 &media_log_,
66 base::Bind(&DecryptingDemuxerStreamTest::OnWaitingForDecryptionKey, 66 base::Bind(&DecryptingDemuxerStreamTest::OnWaitingForDecryptionKey,
67 base::Unretained(this)))), 67 base::Unretained(this)))),
68 cdm_context_(new StrictMock<MockCdmContext>()), 68 cdm_context_(new StrictMock<MockCdmContext>()),
69 decryptor_(new StrictMock<MockDecryptor>()), 69 decryptor_(new StrictMock<MockDecryptor>()),
70 is_initialized_(false), 70 is_initialized_(false),
71 input_audio_stream_( 71 input_audio_stream_(
72 new StrictMock<MockDemuxerStream>(DemuxerStream::AUDIO)), 72 new StrictMock<MockDemuxerStream>(DemuxerStream::AUDIO)),
73 input_video_stream_( 73 input_video_stream_(
74 new StrictMock<MockDemuxerStream>(DemuxerStream::VIDEO)), 74 new StrictMock<MockDemuxerStream>(DemuxerStream::VIDEO)),
75 clear_buffer_(new DecoderBuffer(kFakeBufferSize)), 75 clear_buffer_(new DecoderBuffer(kFakeBufferSize)),
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 demuxer_stream_->Reset(NewExpectedClosure()); 248 demuxer_stream_->Reset(NewExpectedClosure());
249 base::RunLoop().RunUntilIdle(); 249 base::RunLoop().RunUntilIdle();
250 } 250 }
251 251
252 MOCK_METHOD2(BufferReady, void(DemuxerStream::Status, 252 MOCK_METHOD2(BufferReady, void(DemuxerStream::Status,
253 const scoped_refptr<DecoderBuffer>&)); 253 const scoped_refptr<DecoderBuffer>&));
254 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); 254 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void));
255 255
256 base::MessageLoop message_loop_; 256 base::MessageLoop message_loop_;
257 MediaLog media_log_;
257 std::unique_ptr<DecryptingDemuxerStream> demuxer_stream_; 258 std::unique_ptr<DecryptingDemuxerStream> demuxer_stream_;
258 std::unique_ptr<StrictMock<MockCdmContext>> cdm_context_; 259 std::unique_ptr<StrictMock<MockCdmContext>> cdm_context_;
259 std::unique_ptr<StrictMock<MockDecryptor>> decryptor_; 260 std::unique_ptr<StrictMock<MockDecryptor>> decryptor_;
260 // Whether the |demuxer_stream_| is successfully initialized. 261 // Whether the |demuxer_stream_| is successfully initialized.
261 bool is_initialized_; 262 bool is_initialized_;
262 std::unique_ptr<StrictMock<MockDemuxerStream>> input_audio_stream_; 263 std::unique_ptr<StrictMock<MockDemuxerStream>> input_audio_stream_;
263 std::unique_ptr<StrictMock<MockDemuxerStream>> input_video_stream_; 264 std::unique_ptr<StrictMock<MockDemuxerStream>> input_video_stream_;
264 265
265 DemuxerStream::ReadCB pending_demuxer_read_cb_; 266 DemuxerStream::ReadCB pending_demuxer_read_cb_;
266 Decryptor::NewKeyCB key_added_cb_; 267 Decryptor::NewKeyCB key_added_cb_;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 529 }
529 530
530 // Test destruction after reset. 531 // Test destruction after reset.
531 TEST_F(DecryptingDemuxerStreamTest, Destroy_AfterReset) { 532 TEST_F(DecryptingDemuxerStreamTest, Destroy_AfterReset) {
532 Initialize(); 533 Initialize();
533 EnterNormalReadingState(); 534 EnterNormalReadingState();
534 Reset(); 535 Reset();
535 } 536 }
536 537
537 } // namespace media 538 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decrypting_demuxer_stream.cc ('k') | media/filters/decrypting_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698