| 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 <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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Use anonymous namespace here to prevent the actions to be defined multiple | 50 // Use anonymous namespace here to prevent the actions to be defined multiple |
| 51 // times across multiple test files. Sadly we can't use static for them. | 51 // times across multiple test files. Sadly we can't use static for them. |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 ACTION_P(ReturnBuffer, buffer) { | 54 ACTION_P(ReturnBuffer, buffer) { |
| 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 MATCHER(IsEndOfStream, "end of stream") { | |
| 59 return arg->end_of_stream(); | |
| 60 } | |
| 61 | |
| 62 } // namespace | 58 } // namespace |
| 63 | 59 |
| 64 class DecryptingDemuxerStreamTest : public testing::Test { | 60 class DecryptingDemuxerStreamTest : public testing::Test { |
| 65 public: | 61 public: |
| 66 DecryptingDemuxerStreamTest() | 62 DecryptingDemuxerStreamTest() |
| 67 : demuxer_stream_(new DecryptingDemuxerStream( | 63 : demuxer_stream_(new DecryptingDemuxerStream( |
| 68 message_loop_.task_runner(), | 64 message_loop_.task_runner(), |
| 69 new MediaLog(), | 65 new MediaLog(), |
| 70 base::Bind(&DecryptingDemuxerStreamTest::OnWaitingForDecryptionKey, | 66 base::Bind(&DecryptingDemuxerStreamTest::OnWaitingForDecryptionKey, |
| 71 base::Unretained(this)))), | 67 base::Unretained(this)))), |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 } | 516 } |
| 521 | 517 |
| 522 // Test destruction after reset. | 518 // Test destruction after reset. |
| 523 TEST_F(DecryptingDemuxerStreamTest, Destroy_AfterReset) { | 519 TEST_F(DecryptingDemuxerStreamTest, Destroy_AfterReset) { |
| 524 Initialize(); | 520 Initialize(); |
| 525 EnterNormalReadingState(); | 521 EnterNormalReadingState(); |
| 526 Reset(); | 522 Reset(); |
| 527 } | 523 } |
| 528 | 524 |
| 529 } // namespace media | 525 } // namespace media |
| OLD | NEW |