| 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 "content/browser/presentation/presentation_service_impl.h" | 5 #include "content/browser/presentation/presentation_service_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 class MockPresentationConnection : public blink::mojom::PresentationConnection { | 188 class MockPresentationConnection : public blink::mojom::PresentationConnection { |
| 189 public: | 189 public: |
| 190 void SetTargetConnection( | 190 void SetTargetConnection( |
| 191 blink::mojom::PresentationConnectionPtr connection) override { | 191 blink::mojom::PresentationConnectionPtr connection) override { |
| 192 SetTargetConnection(*connection); | 192 SetTargetConnection(*connection); |
| 193 } | 193 } |
| 194 MOCK_METHOD1(SetTargetConnection, | 194 MOCK_METHOD1(SetTargetConnection, |
| 195 void(blink::mojom::PresentationConnection& connection)); | 195 void(blink::mojom::PresentationConnection& connection)); |
| 196 | 196 |
| 197 void OnMessage(blink::mojom::SessionMessagePtr message) override { | 197 void OnMessage(blink::mojom::SessionMessagePtr message, |
| 198 const base::Callback<void(bool)>& send_message_cb) override { |
| 198 OnConnectionMessageReceived(*message); | 199 OnConnectionMessageReceived(*message); |
| 199 } | 200 } |
| 200 MOCK_METHOD1(OnConnectionMessageReceived, | 201 MOCK_METHOD1(OnConnectionMessageReceived, |
| 201 void(const blink::mojom::SessionMessage& message)); | 202 void(const blink::mojom::SessionMessage& message)); |
| 203 MOCK_METHOD1(DidChangeState, |
| 204 void(blink::mojom::PresentationConnectionState state)); |
| 202 }; | 205 }; |
| 203 | 206 |
| 204 class MockPresentationServiceClient | 207 class MockPresentationServiceClient |
| 205 : public blink::mojom::PresentationServiceClient { | 208 : public blink::mojom::PresentationServiceClient { |
| 206 public: | 209 public: |
| 207 MOCK_METHOD2(OnScreenAvailabilityUpdated, | 210 MOCK_METHOD2(OnScreenAvailabilityUpdated, |
| 208 void(const GURL& url, bool available)); | 211 void(const GURL& url, bool available)); |
| 209 void OnConnectionStateChanged( | 212 void OnConnectionStateChanged( |
| 210 blink::mojom::PresentationSessionInfoPtr connection, | 213 blink::mojom::PresentationSessionInfoPtr connection, |
| 211 blink::mojom::PresentationConnectionState new_state) override { | 214 blink::mojom::PresentationConnectionState new_state) override { |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 mock_delegate_.set_screen_availability_listening_supported(false); | 969 mock_delegate_.set_screen_availability_listening_supported(false); |
| 967 base::RunLoop run_loop; | 970 base::RunLoop run_loop; |
| 968 EXPECT_CALL(mock_client_, | 971 EXPECT_CALL(mock_client_, |
| 969 OnScreenAvailabilityNotSupported(presentation_url1_)) | 972 OnScreenAvailabilityNotSupported(presentation_url1_)) |
| 970 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 973 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
| 971 ListenForScreenAvailabilityAndWait(presentation_url1_, false); | 974 ListenForScreenAvailabilityAndWait(presentation_url1_, false); |
| 972 run_loop.Run(); | 975 run_loop.Run(); |
| 973 } | 976 } |
| 974 | 977 |
| 975 } // namespace content | 978 } // namespace content |
| OLD | NEW |