OLD | NEW |
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // |test_loader_| will be used when Start() is called. | 60 // |test_loader_| will be used when Start() is called. |
61 loader->test_loader_ = scoped_ptr<WebURLLoader>(url_loader); | 61 loader->test_loader_ = scoped_ptr<WebURLLoader>(url_loader); |
62 return loader; | 62 return loader; |
63 } | 63 } |
64 | 64 |
65 bool loading() { return loading_; } | 65 bool loading() { return loading_; } |
66 void set_loading(bool loading) { loading_ = loading; } | 66 void set_loading(bool loading) { loading_ = loading; } |
67 | 67 |
68 private: | 68 private: |
| 69 virtual ~MockBufferedDataSource() {} |
| 70 |
69 // Whether the resource load has starting loading but yet to been cancelled. | 71 // Whether the resource load has starting loading but yet to been cancelled. |
70 bool loading_; | 72 bool loading_; |
71 | 73 |
72 DISALLOW_COPY_AND_ASSIGN(MockBufferedDataSource); | 74 DISALLOW_COPY_AND_ASSIGN(MockBufferedDataSource); |
73 }; | 75 }; |
74 | 76 |
75 static const int64 kFileSize = 5000000; | 77 static const int64 kFileSize = 5000000; |
76 static const int64 kFarReadPosition = 4000000; | 78 static const int64 kFarReadPosition = 4000000; |
77 static const int kDataSize = 1024; | 79 static const int kDataSize = 1024; |
78 | 80 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 450 |
449 // During teardown we'll also report our final network status. | 451 // During teardown we'll also report our final network status. |
450 EXPECT_CALL(host_, SetNetworkActivity(false)); | 452 EXPECT_CALL(host_, SetNetworkActivity(false)); |
451 EXPECT_CALL(host_, SetBufferedBytes(kDataSize)); | 453 EXPECT_CALL(host_, SetBufferedBytes(kDataSize)); |
452 | 454 |
453 EXPECT_TRUE(data_source_->loading()); | 455 EXPECT_TRUE(data_source_->loading()); |
454 Stop(); | 456 Stop(); |
455 } | 457 } |
456 | 458 |
457 } // namespace webkit_media | 459 } // namespace webkit_media |
OLD | NEW |