| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch2); | 1084 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch2); |
| 1085 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch3); | 1085 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch3); |
| 1086 // As each |observer| goes out-of-scope, its destructor will ensure all | 1086 // As each |observer| goes out-of-scope, its destructor will ensure all |
| 1087 // expected messages have been received. | 1087 // expected messages have been received. |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 TEST_F(MediaRouterMojoImplTest, PresentationConnectionStateChangedCallback) { | 1090 TEST_F(MediaRouterMojoImplTest, PresentationConnectionStateChangedCallback) { |
| 1091 MediaRoute::Id route_id("route-id"); | 1091 MediaRoute::Id route_id("route-id"); |
| 1092 const GURL presentation_url("http://www.example.com/presentation.html"); | 1092 const GURL presentation_url("http://www.example.com/presentation.html"); |
| 1093 const std::string kPresentationId("pid"); | 1093 const std::string kPresentationId("pid"); |
| 1094 content::PresentationSessionInfo connection(presentation_url, | 1094 content::PresentationInfo connection(presentation_url, kPresentationId); |
| 1095 kPresentationId); | |
| 1096 base::MockCallback<content::PresentationConnectionStateChangedCallback> | 1095 base::MockCallback<content::PresentationConnectionStateChangedCallback> |
| 1097 callback; | 1096 callback; |
| 1098 std::unique_ptr<PresentationConnectionStateSubscription> subscription = | 1097 std::unique_ptr<PresentationConnectionStateSubscription> subscription = |
| 1099 router()->AddPresentationConnectionStateChangedCallback(route_id, | 1098 router()->AddPresentationConnectionStateChangedCallback(route_id, |
| 1100 callback.Get()); | 1099 callback.Get()); |
| 1101 | 1100 |
| 1102 { | 1101 { |
| 1103 base::RunLoop run_loop; | 1102 base::RunLoop run_loop; |
| 1104 content::PresentationConnectionStateChangeInfo closed_info( | 1103 content::PresentationConnectionStateChangeInfo closed_info( |
| 1105 content::PRESENTATION_CONNECTION_STATE_CLOSED); | 1104 content::PRESENTATION_CONNECTION_STATE_CLOSED); |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 EXPECT_CALL(mock_media_route_provider_, | 1570 EXPECT_CALL(mock_media_route_provider_, |
| 1572 UpdateMediaSinks(MediaSourceForDesktop().id())) | 1571 UpdateMediaSinks(MediaSourceForDesktop().id())) |
| 1573 .WillOnce(InvokeWithoutArgs([&run_loop2]() { | 1572 .WillOnce(InvokeWithoutArgs([&run_loop2]() { |
| 1574 run_loop2.Quit(); | 1573 run_loop2.Quit(); |
| 1575 })); | 1574 })); |
| 1576 | 1575 |
| 1577 run_loop2.Run(); | 1576 run_loop2.Run(); |
| 1578 } | 1577 } |
| 1579 | 1578 |
| 1580 } // namespace media_router | 1579 } // namespace media_router |
| OLD | NEW |