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/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "media/base/mock_callback.h" | 8 #include "media/base/mock_callback.h" |
9 #include "media/base/mock_filter_host.h" | 9 #include "media/base/mock_filter_host.h" |
10 #include "media/base/mock_filters.h" | 10 #include "media/base/mock_filters.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 BufferedDataSourceTest() { | 98 BufferedDataSourceTest() { |
99 message_loop_ = MessageLoop::current(); | 99 message_loop_ = MessageLoop::current(); |
100 | 100 |
101 // Prepare test data. | 101 // Prepare test data. |
102 for (size_t i = 0; i < sizeof(data_); ++i) { | 102 for (size_t i = 0; i < sizeof(data_); ++i) { |
103 data_[i] = i; | 103 data_[i] = i; |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 virtual ~BufferedDataSourceTest() { | 107 virtual ~BufferedDataSourceTest() { |
108 ignore_result(frame_.release()); | |
109 } | 108 } |
110 | 109 |
111 void ExpectCreateAndStartResourceLoader(int start_error) { | 110 void ExpectCreateAndStartResourceLoader(int start_error) { |
112 EXPECT_CALL(*data_source_, CreateResourceLoader(_, _)) | 111 EXPECT_CALL(*data_source_, CreateResourceLoader(_, _)) |
113 .WillOnce(Return(loader_.get())); | 112 .WillOnce(Return(loader_.get())); |
114 | 113 |
115 EXPECT_CALL(*loader_, Start(NotNull(), NotNull(), NotNull())) | 114 EXPECT_CALL(*loader_, Start(NotNull(), NotNull(), NotNull())) |
116 .WillOnce( | 115 .WillOnce( |
117 DoAll(Assign(&error_, start_error), | 116 DoAll(Assign(&error_, start_error), |
118 Invoke(this, | 117 Invoke(this, |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 StopDataSource(); | 486 StopDataSource(); |
488 } | 487 } |
489 | 488 |
490 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { | 489 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { |
491 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); | 490 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); |
492 ReadDataSourceTimesOut(20, 10); | 491 ReadDataSourceTimesOut(20, 10); |
493 StopDataSource(); | 492 StopDataSource(); |
494 } | 493 } |
495 | 494 |
496 } // namespace webkit_glue | 495 } // namespace webkit_glue |
OLD | NEW |