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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "media/base/media_log.h" | 9 #include "media/base/media_log.h" |
10 #include "media/base/mock_callback.h" | 10 #include "media/base/mock_callback.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 ON_CALL(*loader_, range_supported()) | 185 ON_CALL(*loader_, range_supported()) |
186 .WillByDefault(Return(partial_response)); | 186 .WillByDefault(Return(partial_response)); |
187 | 187 |
188 ON_CALL(*loader_, url()) | 188 ON_CALL(*loader_, url()) |
189 .WillByDefault(ReturnRef(gurl_)); | 189 .WillByDefault(ReturnRef(gurl_)); |
190 media::PipelineStatus expected_init_status = media::PIPELINE_OK; | 190 media::PipelineStatus expected_init_status = media::PIPELINE_OK; |
191 if (initialized_ok) { | 191 if (initialized_ok) { |
192 // Expected loaded or not. | 192 // Expected loaded or not. |
193 EXPECT_CALL(host_, SetLoaded(loaded)); | 193 EXPECT_CALL(host_, SetLoaded(loaded)); |
194 | 194 |
195 if (instance_size != -1) { | 195 if (instance_size != -1) |
196 EXPECT_CALL(host_, SetTotalBytes(instance_size)); | 196 EXPECT_CALL(host_, SetTotalBytes(instance_size)); |
197 if (loaded) | 197 |
198 EXPECT_CALL(host_, SetBufferedBytes(instance_size)); | 198 if (loaded) |
199 else | 199 EXPECT_CALL(host_, SetBufferedBytes(instance_size)); |
200 EXPECT_CALL(host_, SetBufferedBytes(0)); | 200 else |
201 } | 201 EXPECT_CALL(host_, SetBufferedBytes(0)); |
202 | 202 |
203 if (!partial_response || instance_size == -1) | 203 if (!partial_response || instance_size == -1) |
204 EXPECT_CALL(host_, SetStreaming(true)); | 204 EXPECT_CALL(host_, SetStreaming(true)); |
205 | 205 |
206 } else { | 206 } else { |
207 expected_init_status = media::PIPELINE_ERROR_NETWORK; | 207 expected_init_status = media::PIPELINE_ERROR_NETWORK; |
208 EXPECT_CALL(*loader_, Stop()); | 208 EXPECT_CALL(*loader_, Stop()); |
209 } | 209 } |
210 | 210 |
211 // Actual initialization of the data source. | 211 // Actual initialization of the data source. |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 message_loop_->RunAllPending(); | 783 message_loop_->RunAllPending(); |
784 | 784 |
785 // Verify loader changed but still has same bitrate. | 785 // Verify loader changed but still has same bitrate. |
786 EXPECT_NE(old_loader, data_source_->loader().get()); | 786 EXPECT_NE(old_loader, data_source_->loader().get()); |
787 EXPECT_EQ(2.0f, loader_playback_rate()); | 787 EXPECT_EQ(2.0f, loader_playback_rate()); |
788 | 788 |
789 StopDataSource(); | 789 StopDataSource(); |
790 } | 790 } |
791 | 791 |
792 } // namespace webkit_media | 792 } // namespace webkit_media |
OLD | NEW |