| 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 21 matching lines...) Expand all Loading... |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 #if defined(ENABLE_MOJO_CDM) | 34 #if defined(ENABLE_MOJO_CDM) |
| 35 const char kClearKeyKeySystem[] = "org.w3.clearkey"; | 35 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
| 36 const char kInvalidKeySystem[] = "invalid.key.system"; | 36 const char kInvalidKeySystem[] = "invalid.key.system"; |
| 37 #endif | 37 #endif |
| 38 const char kSecurityOrigin[] = "http://foo.com"; | 38 const char kSecurityOrigin[] = "http://foo.com"; |
| 39 | 39 |
| 40 class MockRendererClient : public interfaces::RendererClient { | 40 class MockRendererClient : public interfaces::RendererClient { |
| 41 public: | 41 public: |
| 42 MockRendererClient(){}; | 42 MockRendererClient() {} |
| 43 ~MockRendererClient() override{}; | 43 ~MockRendererClient() override {} |
| 44 | 44 |
| 45 // interfaces::RendererClient implementation. | 45 // interfaces::RendererClient implementation. |
| 46 MOCK_METHOD2(OnTimeUpdate, void(int64_t time_usec, int64_t max_time_usec)); | 46 MOCK_METHOD2(OnTimeUpdate, void(int64_t time_usec, int64_t max_time_usec)); |
| 47 MOCK_METHOD1(OnBufferingStateChange, void(interfaces::BufferingState state)); | 47 MOCK_METHOD1(OnBufferingStateChange, void(interfaces::BufferingState state)); |
| 48 MOCK_METHOD0(OnEnded, void()); | 48 MOCK_METHOD0(OnEnded, void()); |
| 49 MOCK_METHOD0(OnError, void()); | 49 MOCK_METHOD0(OnError, void()); |
| 50 MOCK_METHOD1(OnVideoOpacityChange, void(bool opaque)); |
| 51 |
| 52 // TODO(alokp): gmock does not support move-only function arguments. |
| 53 // Convert this into MOCK_METHOD after gmock implements this feature. |
| 54 // https://github.com/google/googletest/issues/395 |
| 55 // If we need to use this mock method before the gmock bug gets fixed, we |
| 56 // would need to define a MOCK_METHOD using non movable type which calls this. |
| 57 void OnVideoNaturalSizeChange(mojo::SizePtr size) override {} |
| 50 | 58 |
| 51 private: | 59 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(MockRendererClient); | 60 DISALLOW_COPY_AND_ASSIGN(MockRendererClient); |
| 53 }; | 61 }; |
| 54 | 62 |
| 55 class MediaShellTest : public shell::test::ShellTest { | 63 class MediaShellTest : public shell::test::ShellTest { |
| 56 public: | 64 public: |
| 57 MediaShellTest() | 65 MediaShellTest() |
| 58 : ShellTest("exe:media_mojo_unittests"), | 66 : ShellTest("exe:media_mojo_unittests"), |
| 59 renderer_client_binding_(&renderer_client_), | 67 renderer_client_binding_(&renderer_client_), |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // close the connection. | 187 // close the connection. |
| 180 EXPECT_CALL(*this, ConnectionClosed()) | 188 EXPECT_CALL(*this, ConnectionClosed()) |
| 181 .Times(Exactly(1)) | 189 .Times(Exactly(1)) |
| 182 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); | 190 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); |
| 183 service_factory_.reset(); | 191 service_factory_.reset(); |
| 184 | 192 |
| 185 run_loop_->Run(); | 193 run_loop_->Run(); |
| 186 } | 194 } |
| 187 | 195 |
| 188 } // namespace media | 196 } // namespace media |
| OLD | NEW |