| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "media/base/filters.h" | 8 #include "media/base/filters.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 EXPECT_CALL(bridge_factory_, OnDestroy()); | 67 EXPECT_CALL(bridge_factory_, OnDestroy()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void Initialize(const char* url, int first_position, int last_position) { | 70 void Initialize(const char* url, int first_position, int last_position) { |
| 71 gurl_ = GURL(url); | 71 gurl_ = GURL(url); |
| 72 first_position_ = first_position; | 72 first_position_ = first_position; |
| 73 last_position_ = last_position; | 73 last_position_ = last_position; |
| 74 | 74 |
| 75 loader_ = new BufferedResourceLoader(&bridge_factory_, gurl_, | 75 loader_ = new BufferedResourceLoader(&bridge_factory_, gurl_, |
| 76 first_position_, last_position_); | 76 first_position_, last_position_); |
| 77 EXPECT_EQ(gurl_.spec(), loader_->GetURLForDebugging()); | 77 EXPECT_EQ(gurl_.spec(), loader_->GetURLForDebugging().spec()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void Start() { | 80 void Start() { |
| 81 InSequence s; | 81 InSequence s; |
| 82 EXPECT_CALL(bridge_factory_, | 82 EXPECT_CALL(bridge_factory_, |
| 83 CreateBridge(gurl_, _, first_position_, last_position_)) | 83 CreateBridge(gurl_, _, first_position_, last_position_)) |
| 84 .WillOnce(Return(bridge_.get())); | 84 .WillOnce(Return(bridge_.get())); |
| 85 EXPECT_CALL(*bridge_, Start(loader_.get())); | 85 EXPECT_CALL(*bridge_, Start(loader_.get())); |
| 86 loader_->Start( | 86 loader_->Start( |
| 87 NewCallback(this, &BufferedResourceLoaderTest::StartCallback), | 87 NewCallback(this, &BufferedResourceLoaderTest::StartCallback), |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 StopDataSource(); | 774 StopDataSource(); |
| 775 } | 775 } |
| 776 | 776 |
| 777 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { | 777 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { |
| 778 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); | 778 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); |
| 779 ReadDataSourceTimesOut(20, 10); | 779 ReadDataSourceTimesOut(20, 10); |
| 780 StopDataSource(); | 780 StopDataSource(); |
| 781 } | 781 } |
| 782 | 782 |
| 783 } // namespace webkit_glue | 783 } // namespace webkit_glue |
| OLD | NEW |