| 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 #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/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void Initialize(const char* url, int first_position, int last_position) { | 79 void Initialize(const char* url, int first_position, int last_position) { |
| 80 gurl_ = GURL(url); | 80 gurl_ = GURL(url); |
| 81 first_position_ = first_position; | 81 first_position_ = first_position; |
| 82 last_position_ = last_position; | 82 last_position_ = last_position; |
| 83 | 83 |
| 84 url_loader_ = new NiceMock<MockWebURLLoader>(); | 84 url_loader_ = new NiceMock<MockWebURLLoader>(); |
| 85 loader_.reset(new BufferedResourceLoader( | 85 loader_.reset(new BufferedResourceLoader( |
| 86 gurl_, first_position_, last_position_, | 86 gurl_, first_position_, last_position_, |
| 87 BufferedResourceLoader::kThresholdDefer, 0, 0, | 87 BufferedResourceLoader::kThresholdDefer, 0, 0, |
| 88 new media::MediaLog())); | 88 new media::MediaLog())); |
| 89 loader_->SetURLLoaderForTest(url_loader_); | 89 loader_->SetURLLoaderForTest(scoped_ptr<WebKit::WebURLLoader>(url_loader_)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void SetLoaderBuffer(size_t forward_capacity, size_t backward_capacity) { | 92 void SetLoaderBuffer(size_t forward_capacity, size_t backward_capacity) { |
| 93 loader_->buffer_.reset( | 93 loader_->buffer_.reset( |
| 94 new media::SeekableBuffer(backward_capacity, forward_capacity)); | 94 new media::SeekableBuffer(backward_capacity, forward_capacity)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void Start() { | 97 void Start() { |
| 98 InSequence s; | 98 InSequence s; |
| 99 EXPECT_CALL(*url_loader_, loadAsynchronously(Truly(CorrectAcceptEncoding), | 99 EXPECT_CALL(*url_loader_, loadAsynchronously(Truly(CorrectAcceptEncoding), |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 | 1086 |
| 1087 TEST_F(BufferedResourceLoaderTest, BufferWindow_PlaybackRate_AboveUpperBound) { | 1087 TEST_F(BufferedResourceLoaderTest, BufferWindow_PlaybackRate_AboveUpperBound) { |
| 1088 Initialize(kHttpUrl, -1, -1); | 1088 Initialize(kHttpUrl, -1, -1); |
| 1089 Start(); | 1089 Start(); |
| 1090 loader_->SetPlaybackRate(100); | 1090 loader_->SetPlaybackRate(100); |
| 1091 CheckBufferWindowBounds(); | 1091 CheckBufferWindowBounds(); |
| 1092 StopWhenLoad(); | 1092 StopWhenLoad(); |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 } // namespace webkit_media | 1095 } // namespace webkit_media |
| OLD | NEW |