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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "media/base/audio_decoder_config.h" | 7 #include "media/base/audio_decoder_config.h" |
8 #include "media/base/decoder_buffer.h" | 8 #include "media/base/decoder_buffer.h" |
9 #include "media/base/mock_demuxer_host.h" | 9 #include "media/base/mock_demuxer_host.h" |
10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
(...skipping 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2508 | 2508 |
2509 scoped_ptr<Cluster> cluster_a(kDefaultFirstCluster()); | 2509 scoped_ptr<Cluster> cluster_a(kDefaultFirstCluster()); |
2510 ASSERT_TRUE(AppendData(cluster_a->data(), cluster_a->size())); | 2510 ASSERT_TRUE(AppendData(cluster_a->data(), cluster_a->size())); |
2511 demuxer_->EndOfStream(PIPELINE_OK); | 2511 demuxer_->EndOfStream(PIPELINE_OK); |
2512 | 2512 |
2513 scoped_ptr<Cluster> cluster_b(kDefaultSecondCluster()); | 2513 scoped_ptr<Cluster> cluster_b(kDefaultSecondCluster()); |
2514 ASSERT_TRUE(AppendData(cluster_b->data(), cluster_b->size())); | 2514 ASSERT_TRUE(AppendData(cluster_b->data(), cluster_b->size())); |
2515 demuxer_->EndOfStream(PIPELINE_OK); | 2515 demuxer_->EndOfStream(PIPELINE_OK); |
2516 } | 2516 } |
2517 | 2517 |
| 2518 // Test receiving a Shutdown() call before we get an Initialize() |
| 2519 // call. This can happen if video element gets destroyed before |
| 2520 // the pipeline has a chance to initialize the demuxer. |
| 2521 TEST_F(ChunkDemuxerTest, TestShutdownBeforeInitialize) { |
| 2522 demuxer_->Shutdown(); |
| 2523 demuxer_->Initialize( |
| 2524 &host_, CreateInitDoneCB(DEMUXER_ERROR_COULD_NOT_OPEN)); |
| 2525 message_loop_.RunUntilIdle(); |
| 2526 } |
| 2527 |
2518 } // namespace media | 2528 } // namespace media |
OLD | NEW |