| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "media/base/gmock_callback_support.h" | 9 #include "media/base/gmock_callback_support.h" |
| 10 #include "media/base/mock_filters.h" | 10 #include "media/base/mock_filters.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 decoder_selector_.reset(new AudioDecoderSelector( | 130 decoder_selector_.reset(new AudioDecoderSelector( |
| 131 message_loop_.message_loop_proxy(), | 131 message_loop_.message_loop_proxy(), |
| 132 all_decoders_.Pass(), | 132 all_decoders_.Pass(), |
| 133 set_decryptor_ready_cb)); | 133 set_decryptor_ready_cb)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void SelectDecoder() { | 136 void SelectDecoder() { |
| 137 decoder_selector_->SelectDecoder( | 137 decoder_selector_->SelectDecoder( |
| 138 demuxer_stream_.get(), | 138 demuxer_stream_.get(), |
| 139 false, | |
| 140 base::Bind(&AudioDecoderSelectorTest::MockOnDecoderSelected, | 139 base::Bind(&AudioDecoderSelectorTest::MockOnDecoderSelected, |
| 141 base::Unretained(this)), | 140 base::Unretained(this)), |
| 142 base::Bind(&AudioDecoderSelectorTest::OnDecoderOutput)); | 141 base::Bind(&AudioDecoderSelectorTest::OnDecoderOutput)); |
| 143 message_loop_.RunUntilIdle(); | 142 message_loop_.RunUntilIdle(); |
| 144 } | 143 } |
| 145 | 144 |
| 146 void SelectDecoderAndDestroy() { | 145 void SelectDecoderAndDestroy() { |
| 147 SelectDecoder(); | 146 SelectDecoder(); |
| 148 | 147 |
| 149 EXPECT_CALL(*this, OnDecoderSelected(IsNull(), IsNull())); | 148 EXPECT_CALL(*this, OnDecoderSelected(IsNull(), IsNull())); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 } | 354 } |
| 356 | 355 |
| 357 TEST_F(AudioDecoderSelectorTest, Destroy_EncryptedStream_DecryptAndDecode) { | 356 TEST_F(AudioDecoderSelectorTest, Destroy_EncryptedStream_DecryptAndDecode) { |
| 358 UseEncryptedStream(); | 357 UseEncryptedStream(); |
| 359 InitializeDecoderSelector(kHoldSetDecryptor, 1); | 358 InitializeDecoderSelector(kHoldSetDecryptor, 1); |
| 360 | 359 |
| 361 SelectDecoderAndDestroy(); | 360 SelectDecoderAndDestroy(); |
| 362 } | 361 } |
| 363 | 362 |
| 364 } // namespace media | 363 } // namespace media |
| OLD | NEW |