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

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

Issue 1829163002: Lazily prune the multibuffer block cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no export Created 4 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/multibuffer.cc ('k') | media/blink/multibuffer_unittest.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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 bool is_local_source() { return data_source_->assume_fully_buffered(); } 449 bool is_local_source() { return data_source_->assume_fully_buffered(); }
450 void set_might_be_reused_from_cache_in_future(bool value) { 450 void set_might_be_reused_from_cache_in_future(bool value) {
451 data_source_->url_data_->set_cacheable(value); 451 data_source_->url_data_->set_cacheable(value);
452 } 452 }
453 453
454 protected: 454 protected:
455 MockWebFrameClient client_; 455 MockWebFrameClient client_;
456 WebView* view_; 456 WebView* view_;
457 WebLocalFrame* frame_; 457 WebLocalFrame* frame_;
458 MultibufferDataSource::Preload preload_; 458 MultibufferDataSource::Preload preload_;
459 base::MessageLoop message_loop_;
459 linked_ptr<TestUrlIndex> url_index_; 460 linked_ptr<TestUrlIndex> url_index_;
460 461
461 scoped_ptr<MockMultibufferDataSource> data_source_; 462 scoped_ptr<MockMultibufferDataSource> data_source_;
462 463
463 scoped_ptr<TestResponseGenerator> response_generator_; 464 scoped_ptr<TestResponseGenerator> response_generator_;
464 465
465 StrictMock<MockBufferedDataSourceHost> host_; 466 StrictMock<MockBufferedDataSourceHost> host_;
466 base::MessageLoop message_loop_;
467 467
468 // Used for calling MultibufferDataSource::Read(). 468 // Used for calling MultibufferDataSource::Read().
469 uint8_t buffer_[kDataSize * 2]; 469 uint8_t buffer_[kDataSize * 2];
470 470
471 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSourceTest); 471 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSourceTest);
472 }; 472 };
473 473
474 TEST_F(MultibufferDataSourceTest, Range_Supported) { 474 TEST_F(MultibufferDataSourceTest, Range_Supported) {
475 InitializeWith206Response(); 475 InitializeWith206Response();
476 476
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 data_provider()->willFollowRedirect(url_loader(), request, response); 1311 data_provider()->willFollowRedirect(url_loader(), request, response);
1312 Respond(response_generator_->Generate206(kDataSize)); 1312 Respond(response_generator_->Generate206(kDataSize));
1313 ReceiveData(kDataSize); 1313 ReceiveData(kDataSize);
1314 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize * 3)); 1314 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize * 3));
1315 FinishLoading(); 1315 FinishLoading();
1316 EXPECT_FALSE(loading()); 1316 EXPECT_FALSE(loading());
1317 Stop(); 1317 Stop();
1318 } 1318 }
1319 1319
1320 } // namespace media 1320 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/multibuffer.cc ('k') | media/blink/multibuffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698