| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/media/router/browser_presentation_connection_proxy.h" | 5 #include "chrome/browser/media/router/browser_presentation_connection_proxy.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/test/mock_callback.h" | 8 #include "base/test/mock_callback.h" |
| 9 #include "chrome/browser/media/router/media_source.h" | 9 #include "chrome/browser/media/router/media_source.h" |
| 10 #include "chrome/browser/media/router/media_source_helper.h" | 10 #include "chrome/browser/media/router/media_source_helper.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 void OnMessage(blink::mojom::ConnectionMessagePtr message, | 24 void OnMessage(blink::mojom::ConnectionMessagePtr message, |
| 25 const OnMessageCallback& on_message_callback) override { | 25 const OnMessageCallback& on_message_callback) override { |
| 26 OnMessageRaw(message.get(), on_message_callback); | 26 OnMessageRaw(message.get(), on_message_callback); |
| 27 } | 27 } |
| 28 | 28 |
| 29 MOCK_METHOD2(OnMessageRaw, | 29 MOCK_METHOD2(OnMessageRaw, |
| 30 void(const blink::mojom::ConnectionMessage*, | 30 void(const blink::mojom::ConnectionMessage*, |
| 31 const OnMessageCallback&)); | 31 const OnMessageCallback&)); |
| 32 MOCK_METHOD1(DidChangeState, | 32 MOCK_METHOD1(DidChangeState, |
| 33 void(content::PresentationConnectionState state)); | 33 void(content::PresentationConnectionState state)); |
| 34 MOCK_METHOD0(OnClose, void()); |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 class BrowserPresentationConnectionProxyTest : public ::testing::Test { | 37 class BrowserPresentationConnectionProxyTest : public ::testing::Test { |
| 37 public: | 38 public: |
| 38 BrowserPresentationConnectionProxyTest() = default; | 39 BrowserPresentationConnectionProxyTest() = default; |
| 39 | 40 |
| 40 void SetUp() override { | 41 void SetUp() override { |
| 41 mock_controller_connection_proxy_ = | 42 mock_controller_connection_proxy_ = |
| 42 base::MakeUnique<MockPresentationConnectionProxy>(); | 43 base::MakeUnique<MockPresentationConnectionProxy>(); |
| 43 blink::mojom::PresentationConnectionPtr controller_connection_ptr; | 44 blink::mojom::PresentationConnectionPtr controller_connection_ptr; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 .WillOnce(::testing::Invoke([&expected_data]( | 108 .WillOnce(::testing::Invoke([&expected_data]( |
| 108 const MediaRoute::Id& route_id, std::vector<uint8_t>* data, | 109 const MediaRoute::Id& route_id, std::vector<uint8_t>* data, |
| 109 const BrowserPresentationConnectionProxy::OnMessageCallback& | 110 const BrowserPresentationConnectionProxy::OnMessageCallback& |
| 110 callback) { EXPECT_EQ(expected_data, *data); })); | 111 callback) { EXPECT_EQ(expected_data, *data); })); |
| 111 | 112 |
| 112 browser_connection_proxy()->OnMessage(std::move(session_message), | 113 browser_connection_proxy()->OnMessage(std::move(session_message), |
| 113 mock_on_message_callback.Get()); | 114 mock_on_message_callback.Get()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 } // namespace media_router | 117 } // namespace media_router |
| OLD | NEW |