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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 data_source_->set_host(&host_); | 90 data_source_->set_host(&host_); |
91 } | 91 } |
92 | 92 |
93 virtual ~BufferedDataSourceTest() { | 93 virtual ~BufferedDataSourceTest() { |
94 view_->close(); | 94 view_->close(); |
95 } | 95 } |
96 | 96 |
97 void Initialize(media::PipelineStatus expected) { | 97 void Initialize(media::PipelineStatus expected) { |
98 ExpectCreateResourceLoader(); | 98 ExpectCreateResourceLoader(); |
99 data_source_->Initialize(response_generator_.gurl(), | 99 data_source_->Initialize(response_generator_.gurl(), |
| 100 BufferedResourceLoader::kUnspecified, |
100 media::NewExpectedStatusCB(expected)); | 101 media::NewExpectedStatusCB(expected)); |
101 message_loop_.RunAllPending(); | 102 message_loop_.RunAllPending(); |
102 } | 103 } |
103 | 104 |
104 // Helper to initialize tests with a valid 206 response. | 105 // Helper to initialize tests with a valid 206 response. |
105 void InitializeWith206Response() { | 106 void InitializeWith206Response() { |
106 Initialize(media::PIPELINE_OK); | 107 Initialize(media::PIPELINE_OK); |
107 | 108 |
108 EXPECT_CALL(host_, SetTotalBytes(response_generator_.content_length())); | 109 EXPECT_CALL(host_, SetTotalBytes(response_generator_.content_length())); |
109 Respond(response_generator_.Generate206(0)); | 110 Respond(response_generator_.Generate206(0)); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 438 |
438 // During teardown we'll also report our final network status. | 439 // During teardown we'll also report our final network status. |
439 EXPECT_CALL(host_, SetNetworkActivity(false)); | 440 EXPECT_CALL(host_, SetNetworkActivity(false)); |
440 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1)); | 441 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1)); |
441 | 442 |
442 EXPECT_TRUE(data_source_->loading()); | 443 EXPECT_TRUE(data_source_->loading()); |
443 Stop(); | 444 Stop(); |
444 } | 445 } |
445 | 446 |
446 } // namespace webkit_media | 447 } // namespace webkit_media |
OLD | NEW |