| 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 <iterator> | 10 #include <iterator> |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 .WillOnce(SaveArg<0>(&callback)); | 621 .WillOnce(SaveArg<0>(&callback)); |
| 622 | 622 |
| 623 blink::mojom::PresentationServiceClientPtr client_ptr; | 623 blink::mojom::PresentationServiceClientPtr client_ptr; |
| 624 client_binding_.reset( | 624 client_binding_.reset( |
| 625 new mojo::Binding<blink::mojom::PresentationServiceClient>( | 625 new mojo::Binding<blink::mojom::PresentationServiceClient>( |
| 626 &mock_client_, mojo::MakeRequest(&client_ptr))); | 626 &mock_client_, mojo::MakeRequest(&client_ptr))); |
| 627 service_impl.controller_delegate_ = nullptr; | 627 service_impl.controller_delegate_ = nullptr; |
| 628 service_impl.SetClient(std::move(client_ptr)); | 628 service_impl.SetClient(std::move(client_ptr)); |
| 629 EXPECT_FALSE(callback.is_null()); | 629 EXPECT_FALSE(callback.is_null()); |
| 630 | 630 |
| 631 // NO-OP for ControllerPresentationServiceDelegate API functions | |
| 632 PresentationInfo presentation_info(presentation_url1_, kPresentationId); | 631 PresentationInfo presentation_info(presentation_url1_, kPresentationId); |
| 633 EXPECT_CALL(mock_delegate_, ListenForConnectionMessages(_, _, _, _)).Times(0); | |
| 634 service_impl.ListenForConnectionMessages(presentation_info); | |
| 635 | 632 |
| 636 // Client gets notified of receiver connections. | 633 // Client gets notified of receiver connections. |
| 637 blink::mojom::PresentationConnectionPtr controller_connection; | 634 blink::mojom::PresentationConnectionPtr controller_connection; |
| 638 MockPresentationConnection mock_presentation_connection; | 635 MockPresentationConnection mock_presentation_connection; |
| 639 mojo::Binding<blink::mojom::PresentationConnection> connection_binding( | 636 mojo::Binding<blink::mojom::PresentationConnection> connection_binding( |
| 640 &mock_presentation_connection, mojo::MakeRequest(&controller_connection)); | 637 &mock_presentation_connection, mojo::MakeRequest(&controller_connection)); |
| 641 blink::mojom::PresentationConnectionPtr receiver_connection; | 638 blink::mojom::PresentationConnectionPtr receiver_connection; |
| 642 EXPECT_CALL(mock_client_, | 639 EXPECT_CALL(mock_client_, |
| 643 OnReceiverConnectionAvailable(InfoEquals(presentation_info))); | 640 OnReceiverConnectionAvailable(InfoEquals(presentation_info))); |
| 644 callback.Run(presentation_info, std::move(controller_connection), | 641 callback.Run(presentation_info, std::move(controller_connection), |
| 645 mojo::MakeRequest(&receiver_connection)); | 642 mojo::MakeRequest(&receiver_connection)); |
| 646 base::RunLoop().RunUntilIdle(); | 643 base::RunLoop().RunUntilIdle(); |
| 647 | 644 |
| 648 EXPECT_CALL(mock_receiver_delegate, RemoveObserver(_, _)).Times(1); | 645 EXPECT_CALL(mock_receiver_delegate, RemoveObserver(_, _)).Times(1); |
| 649 } | 646 } |
| 650 | 647 |
| 651 } // namespace content | 648 } // namespace content |
| OLD | NEW |