OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "media/base/mock_callback.h" | 8 #include "media/base/mock_callback.h" |
9 #include "media/base/mock_filter_host.h" | 9 #include "media/base/mock_filter_host.h" |
10 #include "media/base/mock_filters.h" | 10 #include "media/base/mock_filters.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } else { | 189 } else { |
190 EXPECT_CALL(host_, SetStreaming(true)); | 190 EXPECT_CALL(host_, SetStreaming(true)); |
191 } | 191 } |
192 } else { | 192 } else { |
193 expected_init_status = media::PIPELINE_ERROR_NETWORK; | 193 expected_init_status = media::PIPELINE_ERROR_NETWORK; |
194 EXPECT_CALL(*loader_, Stop()); | 194 EXPECT_CALL(*loader_, Stop()); |
195 } | 195 } |
196 | 196 |
197 // Actual initialization of the data source. | 197 // Actual initialization of the data source. |
198 data_source_->Initialize(url, | 198 data_source_->Initialize(url, |
199 media::NewExpectedStatusCallback(expected_init_status)); | 199 media::NewExpectedStatusCB(expected_init_status)); |
200 message_loop_->RunAllPending(); | 200 message_loop_->RunAllPending(); |
201 | 201 |
202 if (initialized_ok) { | 202 if (initialized_ok) { |
203 // Verify the size of the data source. | 203 // Verify the size of the data source. |
204 int64 size; | 204 int64 size; |
205 if (instance_size != -1 && (loaded || partial_response)) { | 205 if (instance_size != -1 && (loaded || partial_response)) { |
206 EXPECT_TRUE(data_source_->GetSize(&size)); | 206 EXPECT_TRUE(data_source_->GetSize(&size)); |
207 EXPECT_EQ(instance_size, size); | 207 EXPECT_EQ(instance_size, size); |
208 } else { | 208 } else { |
209 EXPECT_TRUE(data_source_->IsStreaming()); | 209 EXPECT_TRUE(data_source_->IsStreaming()); |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 // single Read() request. | 577 // single Read() request. |
578 TEST_F(BufferedDataSourceTest, BoundedCacheMisses) { | 578 TEST_F(BufferedDataSourceTest, BoundedCacheMisses) { |
579 InitializeDataSource(kHttpUrl, net::OK, true, 1024, LOADING); | 579 InitializeDataSource(kHttpUrl, net::OK, true, 1024, LOADING); |
580 | 580 |
581 ReadDataSourceAlwaysCacheMiss(0, 10); | 581 ReadDataSourceAlwaysCacheMiss(0, 10); |
582 | 582 |
583 StopDataSource(); | 583 StopDataSource(); |
584 } | 584 } |
585 | 585 |
586 } // namespace webkit_glue | 586 } // namespace webkit_glue |
OLD | NEW |