OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 Initialize(kHttpUrl, -1, -1); | 1061 Initialize(kHttpUrl, -1, -1); |
1062 Start(); | 1062 Start(); |
1063 loader_->SetPlaybackRate(0); | 1063 loader_->SetPlaybackRate(0); |
1064 CheckBufferWindowBounds(); | 1064 CheckBufferWindowBounds(); |
1065 StopWhenLoad(); | 1065 StopWhenLoad(); |
1066 } | 1066 } |
1067 | 1067 |
1068 TEST_F(BufferedResourceLoaderTest, BufferWindow_PlaybackRate_BelowLowerBound) { | 1068 TEST_F(BufferedResourceLoaderTest, BufferWindow_PlaybackRate_BelowLowerBound) { |
1069 Initialize(kHttpUrl, -1, -1); | 1069 Initialize(kHttpUrl, -1, -1); |
1070 Start(); | 1070 Start(); |
1071 loader_->SetPlaybackRate(0.1f); | 1071 loader_->SetPlaybackRate(0.1); |
1072 CheckBufferWindowBounds(); | 1072 CheckBufferWindowBounds(); |
1073 StopWhenLoad(); | 1073 StopWhenLoad(); |
1074 } | 1074 } |
1075 | 1075 |
1076 TEST_F(BufferedResourceLoaderTest, BufferWindow_PlaybackRate_WithinBounds) { | 1076 TEST_F(BufferedResourceLoaderTest, BufferWindow_PlaybackRate_WithinBounds) { |
1077 Initialize(kHttpUrl, -1, -1); | 1077 Initialize(kHttpUrl, -1, -1); |
1078 Start(); | 1078 Start(); |
1079 loader_->SetPlaybackRate(10); | 1079 loader_->SetPlaybackRate(10); |
1080 CheckBufferWindowBounds(); | 1080 CheckBufferWindowBounds(); |
1081 StopWhenLoad(); | 1081 StopWhenLoad(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 | 1150 |
1151 // As soon as we have received enough data to fulfill the read, defer. | 1151 // As soon as we have received enough data to fulfill the read, defer. |
1152 EXPECT_CALL(*this, LoadingCallback(BufferedResourceLoader::kLoadingDeferred)); | 1152 EXPECT_CALL(*this, LoadingCallback(BufferedResourceLoader::kLoadingDeferred)); |
1153 EXPECT_CALL(*this, ReadCallback(BufferedResourceLoader::kOk, 10)); | 1153 EXPECT_CALL(*this, ReadCallback(BufferedResourceLoader::kOk, 10)); |
1154 WriteLoader(19, 1); | 1154 WriteLoader(19, 1); |
1155 VerifyBuffer(buffer, 10, 10); | 1155 VerifyBuffer(buffer, 10, 10); |
1156 EXPECT_FALSE(HasActiveLoader()); | 1156 EXPECT_FALSE(HasActiveLoader()); |
1157 } | 1157 } |
1158 | 1158 |
1159 } // namespace media | 1159 } // namespace media |
OLD | NEW |