| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size& size)); | 55 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size& size)); |
| 56 MOCK_METHOD1(OnStatisticsUpdate, | 56 MOCK_METHOD1(OnStatisticsUpdate, |
| 57 void(const media::PipelineStatistics& stats)); | 57 void(const media::PipelineStatistics& stats)); |
| 58 MOCK_METHOD0(OnWaitingForDecryptionKey, void()); | 58 MOCK_METHOD0(OnWaitingForDecryptionKey, void()); |
| 59 MOCK_METHOD1(OnDurationChange, void(base::TimeDelta duration)); | 59 MOCK_METHOD1(OnDurationChange, void(base::TimeDelta duration)); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 DISALLOW_COPY_AND_ASSIGN(MockRendererClient); | 62 DISALLOW_COPY_AND_ASSIGN(MockRendererClient); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class MediaServiceTest : public shell::test::ServiceTest { | 65 class MediaServiceTest : public service_manager::test::ServiceTest { |
| 66 public: | 66 public: |
| 67 MediaServiceTest() | 67 MediaServiceTest() |
| 68 : ServiceTest("exe:media_mojo_unittests"), | 68 : ServiceTest("exe:media_mojo_unittests"), |
| 69 renderer_client_binding_(&renderer_client_), | 69 renderer_client_binding_(&renderer_client_), |
| 70 video_stream_(DemuxerStream::VIDEO) {} | 70 video_stream_(DemuxerStream::VIDEO) {} |
| 71 ~MediaServiceTest() override {} | 71 ~MediaServiceTest() override {} |
| 72 | 72 |
| 73 void SetUp() override { | 73 void SetUp() override { |
| 74 ServiceTest::SetUp(); | 74 ServiceTest::SetUp(); |
| 75 | 75 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 mojom::ContentDecryptionModulePtr cdm_; | 139 mojom::ContentDecryptionModulePtr cdm_; |
| 140 mojom::RendererPtr renderer_; | 140 mojom::RendererPtr renderer_; |
| 141 | 141 |
| 142 StrictMock<MockRendererClient> renderer_client_; | 142 StrictMock<MockRendererClient> renderer_client_; |
| 143 mojo::AssociatedBinding<mojom::RendererClient> renderer_client_binding_; | 143 mojo::AssociatedBinding<mojom::RendererClient> renderer_client_binding_; |
| 144 | 144 |
| 145 StrictMock<MockDemuxerStream> video_stream_; | 145 StrictMock<MockDemuxerStream> video_stream_; |
| 146 std::unique_ptr<MojoDemuxerStreamImpl> mojo_video_stream_; | 146 std::unique_ptr<MojoDemuxerStreamImpl> mojo_video_stream_; |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 std::unique_ptr<shell::Connection> connection_; | 149 std::unique_ptr<service_manager::Connection> connection_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(MediaServiceTest); | 151 DISALLOW_COPY_AND_ASSIGN(MediaServiceTest); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace | 154 } // namespace |
| 155 | 155 |
| 156 // Note: base::RunLoop::RunUntilIdle() does not work well in these tests because | 156 // Note: base::RunLoop::RunUntilIdle() does not work well in these tests because |
| 157 // even when the loop is idle, we may still have pending events in the pipe. | 157 // even when the loop is idle, we may still have pending events in the pipe. |
| 158 | 158 |
| 159 #if defined(ENABLE_MOJO_CDM) | 159 #if defined(ENABLE_MOJO_CDM) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // close the connection. | 196 // close the connection. |
| 197 EXPECT_CALL(*this, ConnectionClosed()) | 197 EXPECT_CALL(*this, ConnectionClosed()) |
| 198 .Times(Exactly(1)) | 198 .Times(Exactly(1)) |
| 199 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); | 199 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); |
| 200 service_factory_.reset(); | 200 service_factory_.reset(); |
| 201 | 201 |
| 202 run_loop_->Run(); | 202 run_loop_->Run(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace media | 205 } // namespace media |
| OLD | NEW |