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

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

Issue 10694098: Use maximum capacity instead of a ratio of capacity for BufferedResourceLoader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years, 5 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "media/base/media_log.h" 7 #include "media/base/media_log.h"
8 #include "media/base/mock_callback.h" 8 #include "media/base/mock_callback.h"
9 #include "media/base/mock_data_source_host.h" 9 #include "media/base/mock_data_source_host.h"
10 #include "media/base/mock_filters.h" 10 #include "media/base/mock_filters.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // Verify that the callback was called inside the Stop() call. 372 // Verify that the callback was called inside the Stop() call.
373 EXPECT_TRUE(stop_done_called); 373 EXPECT_TRUE(stop_done_called);
374 message_loop_.RunAllPending(); 374 message_loop_.RunAllPending();
375 } 375 }
376 376
377 TEST_F(BufferedDataSourceTest, DefaultValues) { 377 TEST_F(BufferedDataSourceTest, DefaultValues) {
378 InitializeWith206Response(); 378 InitializeWith206Response();
379 379
380 // Ensure we have sane values for default loading scenario. 380 // Ensure we have sane values for default loading scenario.
381 EXPECT_EQ(AUTO, preload()); 381 EXPECT_EQ(AUTO, preload());
382 EXPECT_EQ(BufferedResourceLoader::kThresholdDefer, defer_strategy()); 382 EXPECT_EQ(BufferedResourceLoader::kCapacityDefer, defer_strategy());
383 383
384 EXPECT_EQ(0, data_source_bitrate()); 384 EXPECT_EQ(0, data_source_bitrate());
385 EXPECT_EQ(0.0f, data_source_playback_rate()); 385 EXPECT_EQ(0.0f, data_source_playback_rate());
386 EXPECT_EQ(0, loader_bitrate()); 386 EXPECT_EQ(0, loader_bitrate());
387 EXPECT_EQ(0.0f, loader_playback_rate()); 387 EXPECT_EQ(0.0f, loader_playback_rate());
388 388
389 EXPECT_TRUE(data_source_->loading()); 389 EXPECT_TRUE(data_source_->loading());
390 Stop(); 390 Stop();
391 } 391 }
392 392
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // Receive last half of the read. 447 // Receive last half of the read.
448 EXPECT_CALL(*this, ReadCallback(kDataSize)); 448 EXPECT_CALL(*this, ReadCallback(kDataSize));
449 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1)); 449 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1));
450 ReceiveData(kDataSize / 2); 450 ReceiveData(kDataSize / 2);
451 451
452 EXPECT_TRUE(data_source_->downloading()); 452 EXPECT_TRUE(data_source_->downloading());
453 Stop(); 453 Stop();
454 } 454 }
455 455
456 } // namespace webkit_media 456 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698