Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: webkit/media/buffered_resource_loader_unittest.cc

Issue 10543007: Add CORS-awareness to HTML5 media elements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/buffered_resource_loader.cc ('k') | webkit/media/webmediaplayer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/media/buffered_resource_loader.cc ('k') | webkit/media/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698