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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 0, | 38 0, |
39 std::vector<SubsampleEntry>()))); | 39 std::vector<SubsampleEntry>()))); |
40 return buffer; | 40 return buffer; |
41 } | 41 } |
42 | 42 |
43 // Use anonymous namespace here to prevent the actions to be defined multiple | 43 // Use anonymous namespace here to prevent the actions to be defined multiple |
44 // times across multiple test files. Sadly we can't use static for them. | 44 // times across multiple test files. Sadly we can't use static for them. |
45 namespace { | 45 namespace { |
46 | 46 |
47 ACTION_P(ReturnBuffer, buffer) { | 47 ACTION_P(ReturnBuffer, buffer) { |
48 arg0.Run(buffer ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); | 48 arg0.Run(buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); |
49 } | 49 } |
50 | 50 |
51 ACTION_P(RunCallbackIfNotNull, param) { | 51 ACTION_P(RunCallbackIfNotNull, param) { |
52 if (!arg0.is_null()) | 52 if (!arg0.is_null()) |
53 arg0.Run(param); | 53 arg0.Run(param); |
54 } | 54 } |
55 | 55 |
56 ACTION_P2(ResetAndRunCallback, callback, param) { | 56 ACTION_P2(ResetAndRunCallback, callback, param) { |
57 base::ResetAndReturn(callback).Run(param); | 57 base::ResetAndReturn(callback).Run(param); |
58 } | 58 } |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 input_audio_stream_->set_audio_decoder_config(new_config); | 409 input_audio_stream_->set_audio_decoder_config(new_config); |
410 | 410 |
411 EXPECT_CALL(*input_audio_stream_, Read(_)) | 411 EXPECT_CALL(*input_audio_stream_, Read(_)) |
412 .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged, | 412 .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged, |
413 scoped_refptr<DecoderBuffer>())); | 413 scoped_refptr<DecoderBuffer>())); |
414 | 414 |
415 ReadAndExpectBufferReadyWith(DemuxerStream::kConfigChanged, NULL); | 415 ReadAndExpectBufferReadyWith(DemuxerStream::kConfigChanged, NULL); |
416 } | 416 } |
417 | 417 |
418 } // namespace media | 418 } // namespace media |
OLD | NEW |