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

Side by Side Diff: webkit/media/buffered_data_source_unittest.cc

Issue 10735016: Collapse HTTP and non-HTTP codepaths into single methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on tot Created 8 years, 5 months 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 | « webkit/media/buffered_data_source.cc ('k') | webkit/media/buffered_resource_loader.h » ('j') | 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/media_log.h" 7 #include "media/base/media_log.h"
8 #include "media/base/mock_callback.h" 8 #include "media/base/mock_callback.h"
9 #include "media/base/mock_data_source_host.h" 9 #include "media/base/mock_data_source_host.h"
10 #include "media/base/mock_filters.h" 10 #include "media/base/mock_filters.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 Respond(response_generator_->GenerateFileResponse(-1)); 458 Respond(response_generator_->GenerateFileResponse(-1));
459 459
460 EXPECT_FALSE(data_source_->loading()); 460 EXPECT_FALSE(data_source_->loading());
461 Stop(); 461 Stop();
462 } 462 }
463 463
464 TEST_F(BufferedDataSourceTest, File_Successful) { 464 TEST_F(BufferedDataSourceTest, File_Successful) {
465 InitializeWithFileResponse(); 465 InitializeWithFileResponse();
466 466
467 EXPECT_TRUE(data_source_->loading()); 467 EXPECT_TRUE(data_source_->loading());
468 EXPECT_FALSE(data_source_->IsStreaming());
468 Stop(); 469 Stop();
469 } 470 }
470 471
471 static void SetTrue(bool* value) { 472 static void SetTrue(bool* value) {
472 *value = true; 473 *value = true;
473 } 474 }
474 475
475 // This test makes sure that Stop() does not require a task to run on 476 // This test makes sure that Stop() does not require a task to run on
476 // |message_loop_| before it calls its callback. This prevents accidental 477 // |message_loop_| before it calls its callback. This prevents accidental
477 // introduction of a pipeline teardown deadlock. The pipeline owner blocks 478 // introduction of a pipeline teardown deadlock. The pipeline owner blocks
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 ReceiveData(kDataSize / 2); 582 ReceiveData(kDataSize / 2);
582 583
583 // Receive last half of the read but no buffering update. 584 // Receive last half of the read but no buffering update.
584 EXPECT_CALL(*this, ReadCallback(kDataSize)); 585 EXPECT_CALL(*this, ReadCallback(kDataSize));
585 ReceiveData(kDataSize / 2); 586 ReceiveData(kDataSize / 2);
586 587
587 Stop(); 588 Stop();
588 } 589 }
589 590
590 } // namespace webkit_media 591 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/buffered_data_source.cc ('k') | webkit/media/buffered_resource_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698