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/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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 // Receive first half of the read but no buffering update. | 584 // Receive first half of the read but no buffering update. |
585 ReceiveData(kDataSize / 2); | 585 ReceiveData(kDataSize / 2); |
586 | 586 |
587 // Receive last half of the read but no buffering update. | 587 // Receive last half of the read but no buffering update. |
588 EXPECT_CALL(*this, ReadCallback(kDataSize)); | 588 EXPECT_CALL(*this, ReadCallback(kDataSize)); |
589 ReceiveData(kDataSize / 2); | 589 ReceiveData(kDataSize / 2); |
590 | 590 |
591 Stop(); | 591 Stop(); |
592 } | 592 } |
593 | 593 |
| 594 TEST_F(BufferedDataSourceTest, Http_FinishLoading) { |
| 595 InitializeWith206Response(); |
| 596 |
| 597 EXPECT_TRUE(data_source_->downloading()); |
| 598 FinishLoading(); |
| 599 EXPECT_FALSE(data_source_->downloading()); |
| 600 |
| 601 Stop(); |
| 602 } |
| 603 |
| 604 TEST_F(BufferedDataSourceTest, File_FinishLoading) { |
| 605 InitializeWithFileResponse(); |
| 606 |
| 607 EXPECT_FALSE(data_source_->downloading()); |
| 608 FinishLoading(); |
| 609 EXPECT_FALSE(data_source_->downloading()); |
| 610 |
| 611 Stop(); |
| 612 } |
| 613 |
594 } // namespace webkit_media | 614 } // namespace webkit_media |
OLD | NEW |