Chromium Code Reviews| 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/public/common/url_constants.h" | 7 #include "content/public/common/url_constants.h" | 
| 8 #include "content/renderer/media/buffered_data_source.h" | |
| 9 #include "content/renderer/media/test_response_generator.h" | 8 #include "content/renderer/media/test_response_generator.h" | 
| 10 #include "content/test/mock_webframeclient.h" | 9 #include "content/test/mock_webframeclient.h" | 
| 11 #include "content/test/mock_weburlloader.h" | 10 #include "content/test/mock_weburlloader.h" | 
| 12 #include "media/base/media_log.h" | 11 #include "media/base/media_log.h" | 
| 13 #include "media/base/mock_filters.h" | 12 #include "media/base/mock_filters.h" | 
| 14 #include "media/base/test_helpers.h" | 13 #include "media/base/test_helpers.h" | 
| 14 #include "media/blink/buffered_data_source.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/WebLocalFrame.h" | 16 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 
| 17 #include "third_party/WebKit/public/web/WebView.h" | 17 #include "third_party/WebKit/public/web/WebView.h" | 
| 18 | 18 | 
| 19 using ::testing::_; | 19 using ::testing::_; | 
| 20 using ::testing::Assign; | 20 using ::testing::Assign; | 
| 21 using ::testing::Invoke; | 21 using ::testing::Invoke; | 
| 22 using ::testing::InSequence; | 22 using ::testing::InSequence; | 
| 23 using ::testing::NiceMock; | 23 using ::testing::NiceMock; | 
| 24 using ::testing::StrictMock; | 24 using ::testing::StrictMock; | 
| 25 | 25 | 
| 26 using blink::WebLocalFrame; | 26 using blink::WebLocalFrame; | 
| 27 using blink::WebString; | 27 using blink::WebString; | 
| 28 using blink::WebURLLoader; | 28 using blink::WebURLLoader; | 
| 29 using blink::WebURLResponse; | 29 using blink::WebURLResponse; | 
| 30 using blink::WebView; | 30 using blink::WebView; | 
| 31 | 31 | 
| 32 namespace content { | 32 using content::MockWebURLLoader; | 
| 33 using content::MockWebFrameClient; | |
| 34 using content::TestResponseGenerator; | |
| 35 | |
| 36 namespace media { | |
| 
 
jamesr
2014/09/02 19:26:44
so long as this test lives in content/... it shoul
 
acolwell GONE FROM CHROMIUM
2014/09/02 20:20:25
I can't move it into media/ because the test relie
 
scherkus (not reviewing)
2014/09/02 20:29:51
Is moving the mocks an option? AFAICT they're only
 
 | |
| 33 | 37 | 
| 34 class MockBufferedDataSourceHost : public BufferedDataSourceHost { | 38 class MockBufferedDataSourceHost : public BufferedDataSourceHost { | 
| 35 public: | 39 public: | 
| 36 MockBufferedDataSourceHost() {} | 40 MockBufferedDataSourceHost() {} | 
| 37 virtual ~MockBufferedDataSourceHost() {} | 41 virtual ~MockBufferedDataSourceHost() {} | 
| 38 | 42 | 
| 39 MOCK_METHOD1(SetTotalBytes, void(int64 total_bytes)); | 43 MOCK_METHOD1(SetTotalBytes, void(int64 total_bytes)); | 
| 40 MOCK_METHOD2(AddBufferedByteRange, void(int64 start, int64 end)); | 44 MOCK_METHOD2(AddBufferedByteRange, void(int64 start, int64 end)); | 
| 41 | 45 | 
| 42 private: | 46 private: | 
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 770 | 774 | 
| 771 data_source_->MediaIsPlaying(); | 775 data_source_->MediaIsPlaying(); | 
| 772 EXPECT_EQ(BufferedResourceLoader::kCapacityDefer, defer_strategy()); | 776 EXPECT_EQ(BufferedResourceLoader::kCapacityDefer, defer_strategy()); | 
| 773 set_might_be_reused_from_cache_in_future(false); | 777 set_might_be_reused_from_cache_in_future(false); | 
| 774 data_source_->MediaIsPaused(); | 778 data_source_->MediaIsPaused(); | 
| 775 EXPECT_EQ(BufferedResourceLoader::kCapacityDefer, defer_strategy()); | 779 EXPECT_EQ(BufferedResourceLoader::kCapacityDefer, defer_strategy()); | 
| 776 | 780 | 
| 777 Stop(); | 781 Stop(); | 
| 778 } | 782 } | 
| 779 | 783 | 
| 780 } // namespace content | 784 } // namespace media | 
| OLD | NEW |