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

Side by Side Diff: media/filters/chunk_demuxer_unittest.cc

Issue 11669011: Fix ChunkDemuxer to handle a Shutdown() call before Initialize() is called. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | 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 "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
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
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698