| OLD | NEW |
| 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 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "media/base/media_log.h" | 9 #include "media/base/media_log.h" |
| 10 #include "media/base/mock_callback.h" | 10 #include "media/base/mock_callback.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 BufferedResourceLoader*(int64 first_position, | 64 BufferedResourceLoader*(int64 first_position, |
| 65 int64 last_position)); | 65 int64 last_position)); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(MockBufferedDataSource); | 68 DISALLOW_COPY_AND_ASSIGN(MockBufferedDataSource); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class MockBufferedResourceLoader : public BufferedResourceLoader { | 71 class MockBufferedResourceLoader : public BufferedResourceLoader { |
| 72 public: | 72 public: |
| 73 MockBufferedResourceLoader() | 73 MockBufferedResourceLoader() |
| 74 : BufferedResourceLoader(GURL(), 0, 0, new media::MediaLog()) { | 74 : BufferedResourceLoader(GURL(), 0, 0, kThresholdDefer, |
| 75 0, 0, new media::MediaLog()) { |
| 75 } | 76 } |
| 76 | 77 |
| 77 MOCK_METHOD3(Start, void(net::OldCompletionCallback* read_callback, | 78 MOCK_METHOD3(Start, void(net::OldCompletionCallback* read_callback, |
| 78 const base::Closure& network_callback, | 79 const base::Closure& network_callback, |
| 79 WebFrame* frame)); | 80 WebFrame* frame)); |
| 80 MOCK_METHOD0(Stop, void()); | 81 MOCK_METHOD0(Stop, void()); |
| 81 MOCK_METHOD4(Read, void(int64 position, int read_size, uint8* buffer, | 82 MOCK_METHOD4(Read, void(int64 position, int read_size, uint8* buffer, |
| 82 net::OldCompletionCallback* callback)); | 83 net::OldCompletionCallback* callback)); |
| 83 MOCK_METHOD0(content_length, int64()); | 84 MOCK_METHOD0(content_length, int64()); |
| 84 MOCK_METHOD0(instance_size, int64()); | 85 MOCK_METHOD0(instance_size, int64()); |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // single Read() request. | 585 // single Read() request. |
| 585 TEST_F(BufferedDataSourceTest, BoundedCacheMisses) { | 586 TEST_F(BufferedDataSourceTest, BoundedCacheMisses) { |
| 586 InitializeDataSource(kHttpUrl, net::OK, true, 1024, LOADING); | 587 InitializeDataSource(kHttpUrl, net::OK, true, 1024, LOADING); |
| 587 | 588 |
| 588 ReadDataSourceAlwaysCacheMiss(0, 10); | 589 ReadDataSourceAlwaysCacheMiss(0, 10); |
| 589 | 590 |
| 590 StopDataSource(); | 591 StopDataSource(); |
| 591 } | 592 } |
| 592 | 593 |
| 593 } // namespace webkit_glue | 594 } // namespace webkit_glue |
| OLD | NEW |