| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "content/renderer/media/buffered_data_source.h" | 7 #include "content/renderer/media/buffered_data_source.h" |
| 8 #include "content/renderer/media/test_response_generator.h" | 8 #include "content/renderer/media/test_response_generator.h" |
| 9 #include "content/test/mock_webframeclient.h" | 9 #include "content/test/mock_webframeclient.h" |
| 10 #include "content/test/mock_weburlloader.h" | 10 #include "content/test/mock_weburlloader.h" |
| 11 #include "media/base/media_log.h" | 11 #include "media/base/media_log.h" |
| 12 #include "media/base/mock_data_source_host.h" | 12 #include "media/base/mock_data_source_host.h" |
| 13 #include "media/base/mock_filters.h" | 13 #include "media/base/mock_filters.h" |
| 14 #include "media/base/test_helpers.h" | 14 #include "media/base/test_helpers.h" |
| 15 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 15 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 16 #include "third_party/WebKit/public/web/WebView.h" | 16 #include "third_party/WebKit/public/web/WebView.h" |
| 17 | 17 |
| 18 using ::testing::_; | 18 using ::testing::_; |
| 19 using ::testing::Assign; | 19 using ::testing::Assign; |
| 20 using ::testing::Invoke; | 20 using ::testing::Invoke; |
| 21 using ::testing::InSequence; | 21 using ::testing::InSequence; |
| 22 using ::testing::NiceMock; | 22 using ::testing::NiceMock; |
| 23 using ::testing::StrictMock; | 23 using ::testing::StrictMock; |
| 24 | 24 |
| 25 using WebKit::WebFrame; | 25 using blink::WebFrame; |
| 26 using WebKit::WebString; | 26 using blink::WebString; |
| 27 using WebKit::WebURLLoader; | 27 using blink::WebURLLoader; |
| 28 using WebKit::WebURLResponse; | 28 using blink::WebURLResponse; |
| 29 using WebKit::WebView; | 29 using blink::WebView; |
| 30 | 30 |
| 31 namespace content { | 31 namespace content { |
| 32 | 32 |
| 33 // Overrides CreateResourceLoader() to permit injecting a MockWebURLLoader. | 33 // Overrides CreateResourceLoader() to permit injecting a MockWebURLLoader. |
| 34 // Also keeps track of whether said MockWebURLLoader is actively loading. | 34 // Also keeps track of whether said MockWebURLLoader is actively loading. |
| 35 class MockBufferedDataSource : public BufferedDataSource { | 35 class MockBufferedDataSource : public BufferedDataSource { |
| 36 public: | 36 public: |
| 37 MockBufferedDataSource( | 37 MockBufferedDataSource( |
| 38 const scoped_refptr<base::MessageLoopProxy>& message_loop, | 38 const scoped_refptr<base::MessageLoopProxy>& message_loop, |
| 39 WebFrame* frame) | 39 WebFrame* frame) |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 InitializeWithFileResponse(); | 645 InitializeWithFileResponse(); |
| 646 | 646 |
| 647 EXPECT_FALSE(data_source_->downloading()); | 647 EXPECT_FALSE(data_source_->downloading()); |
| 648 FinishLoading(); | 648 FinishLoading(); |
| 649 EXPECT_FALSE(data_source_->downloading()); | 649 EXPECT_FALSE(data_source_->downloading()); |
| 650 | 650 |
| 651 Stop(); | 651 Stop(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 } // namespace content | 654 } // namespace content |
| OLD | NEW |