| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 namespace webkit_glue { | 44 namespace webkit_glue { |
| 45 | 45 |
| 46 // Submit a request completed event to the resource loader due to request | 46 // Submit a request completed event to the resource loader due to request |
| 47 // being canceled. Pretending the event is from external. | 47 // being canceled. Pretending the event is from external. |
| 48 ACTION_P(RequestCanceled, loader) { | 48 ACTION_P(RequestCanceled, loader) { |
| 49 URLRequestStatus status; | 49 URLRequestStatus status; |
| 50 status.set_status(URLRequestStatus::CANCELED); | 50 status.set_status(URLRequestStatus::CANCELED); |
| 51 status.set_os_error(net::ERR_ABORTED); |
| 51 loader->OnCompletedRequest(status, ""); | 52 loader->OnCompletedRequest(status, ""); |
| 52 } | 53 } |
| 53 | 54 |
| 54 class BufferedResourceLoaderTest : public testing::Test { | 55 class BufferedResourceLoaderTest : public testing::Test { |
| 55 public: | 56 public: |
| 56 BufferedResourceLoaderTest() { | 57 BufferedResourceLoaderTest() { |
| 57 bridge_.reset(new StrictMock<MockResourceLoaderBridge>()); | 58 bridge_.reset(new StrictMock<MockResourceLoaderBridge>()); |
| 58 | 59 |
| 59 for (int i = 0; i < kDataSize; ++i) | 60 for (int i = 0; i < kDataSize; ++i) |
| 60 data_[i] = i; | 61 data_[i] = i; |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 StopDataSource(); | 758 StopDataSource(); |
| 758 } | 759 } |
| 759 | 760 |
| 760 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { | 761 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { |
| 761 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); | 762 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); |
| 762 ReadDataSourceTimesOut(20, 10); | 763 ReadDataSourceTimesOut(20, 10); |
| 763 StopDataSource(); | 764 StopDataSource(); |
| 764 } | 765 } |
| 765 | 766 |
| 766 } // namespace webkit_glue | 767 } // namespace webkit_glue |
| OLD | NEW |