| 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 "media/base/filters.h" | 5 #include "media/base/filters.h" |
| 6 #include "media/base/mock_callback.h" | 6 #include "media/base/mock_callback.h" |
| 7 #include "media/base/mock_filter_host.h" | 7 #include "media/base/mock_filter_host.h" |
| 8 #include "media/base/mock_filters.h" | 8 #include "media/base/mock_filters.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 class SimpleDataSourceTest : public testing::Test { | 50 class SimpleDataSourceTest : public testing::Test { |
| 51 public: | 51 public: |
| 52 SimpleDataSourceTest() { | 52 SimpleDataSourceTest() { |
| 53 for (int i = 0; i < kDataSize; ++i) { | 53 for (int i = 0; i < kDataSize; ++i) { |
| 54 data_[i] = i; | 54 data_[i] = i; |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual ~SimpleDataSourceTest() { | 58 virtual ~SimpleDataSourceTest() { |
| 59 ignore_result(frame_.release()); | |
| 60 } | 59 } |
| 61 | 60 |
| 62 void InitializeDataSource(const char* url, | 61 void InitializeDataSource(const char* url, |
| 63 media::MockCallback* callback) { | 62 media::MockCallback* callback) { |
| 64 gurl_ = GURL(url); | 63 gurl_ = GURL(url); |
| 65 | 64 |
| 66 frame_.reset(new NiceMock<MockWebFrame>()); | 65 frame_.reset(new NiceMock<MockWebFrame>()); |
| 67 url_loader_ = new NiceMock<MockWebURLLoader>(); | 66 url_loader_ = new NiceMock<MockWebURLLoader>(); |
| 68 | 67 |
| 69 data_source_ = new SimpleDataSource(MessageLoop::current(), | 68 data_source_ = new SimpleDataSource(MessageLoop::current(), |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 207 } |
| 209 | 208 |
| 210 TEST_F(SimpleDataSourceTest, AsyncRead) { | 209 TEST_F(SimpleDataSourceTest, AsyncRead) { |
| 211 InitializeDataSource(kFileUrl, media::NewExpectedCallback()); | 210 InitializeDataSource(kFileUrl, media::NewExpectedCallback()); |
| 212 RequestSucceeded(true); | 211 RequestSucceeded(true); |
| 213 AsyncRead(); | 212 AsyncRead(); |
| 214 DestroyDataSource(); | 213 DestroyDataSource(); |
| 215 } | 214 } |
| 216 | 215 |
| 217 } // namespace webkit_glue | 216 } // namespace webkit_glue |
| OLD | NEW |