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 <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.h" | 10 #include "base/message_loop.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual ~BufferedResourceLoaderTest() { | 77 virtual ~BufferedResourceLoaderTest() { |
78 view_->close(); | 78 view_->close(); |
79 } | 79 } |
80 | 80 |
81 void Initialize(const char* url, int first_position, int last_position) { | 81 void Initialize(const char* url, int first_position, int last_position) { |
82 gurl_ = GURL(url); | 82 gurl_ = GURL(url); |
83 first_position_ = first_position; | 83 first_position_ = first_position; |
84 last_position_ = last_position; | 84 last_position_ = last_position; |
85 | 85 |
86 loader_.reset(new BufferedResourceLoader( | 86 loader_.reset(new BufferedResourceLoader( |
87 gurl_, first_position_, last_position_, | 87 gurl_, BufferedResourceLoader::kUnspecified, |
| 88 first_position_, last_position_, |
88 BufferedResourceLoader::kThresholdDefer, 0, 0, | 89 BufferedResourceLoader::kThresholdDefer, 0, 0, |
89 new media::MediaLog())); | 90 new media::MediaLog())); |
90 | 91 |
91 // |test_loader_| will be used when Start() is called. | 92 // |test_loader_| will be used when Start() is called. |
92 url_loader_ = new NiceMock<MockWebURLLoader>(); | 93 url_loader_ = new NiceMock<MockWebURLLoader>(); |
93 loader_->test_loader_ = scoped_ptr<WebKit::WebURLLoader>(url_loader_); | 94 loader_->test_loader_ = scoped_ptr<WebKit::WebURLLoader>(url_loader_); |
94 } | 95 } |
95 | 96 |
96 void SetLoaderBuffer(int forward_capacity, int backward_capacity) { | 97 void SetLoaderBuffer(int forward_capacity, int backward_capacity) { |
97 loader_->buffer_.set_forward_capacity(forward_capacity); | 98 loader_->buffer_.set_forward_capacity(forward_capacity); |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 ExpectContentRangeFailure("bytes 20-10/400"); | 1179 ExpectContentRangeFailure("bytes 20-10/400"); |
1179 | 1180 |
1180 ExpectContentRangeSuccess("bytes 0-499/500", 0, 499, 500); | 1181 ExpectContentRangeSuccess("bytes 0-499/500", 0, 499, 500); |
1181 ExpectContentRangeSuccess("bytes 0-0/500", 0, 0, 500); | 1182 ExpectContentRangeSuccess("bytes 0-0/500", 0, 0, 500); |
1182 ExpectContentRangeSuccess("bytes 10-11/50", 10, 11, 50); | 1183 ExpectContentRangeSuccess("bytes 10-11/50", 10, 11, 50); |
1183 ExpectContentRangeSuccess("bytes 10-11/*", 10, 11, | 1184 ExpectContentRangeSuccess("bytes 10-11/*", 10, 11, |
1184 kPositionNotSpecified); | 1185 kPositionNotSpecified); |
1185 } | 1186 } |
1186 | 1187 |
1187 } // namespace webkit_media | 1188 } // namespace webkit_media |
OLD | NEW |