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

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

Issue 1094783002: Switch to double for time calculations using playback rate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making changes at chromecast side to fix trybots Created 5 years, 8 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
« no previous file with comments | « media/blink/buffered_resource_loader.cc ('k') | media/blink/webmediaplayer_impl.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « media/blink/buffered_resource_loader.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698