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

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

Issue 9015015: Take advantage of the new Pass() machinery on scoped_ptr{,_malloc}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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/web_data_source_factory.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) 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
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
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
OLDNEW
« no previous file with comments | « webkit/media/buffered_resource_loader.cc ('k') | webkit/media/web_data_source_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698