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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 run_loop.Run(); // Will quit when StartListeningForRouteMessages() is called. | 1075 run_loop.Run(); // Will quit when StartListeningForRouteMessages() is called. |
1076 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch1); | 1076 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch1); |
1077 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch2); | 1077 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch2); |
1078 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch3); | 1078 router()->OnRouteMessagesReceived(expected_route_id, incoming_batch3); |
1079 // As each |observer| goes out-of-scope, its destructor will ensure all | 1079 // As each |observer| goes out-of-scope, its destructor will ensure all |
1080 // expected messages have been received. | 1080 // expected messages have been received. |
1081 } | 1081 } |
1082 | 1082 |
1083 TEST_F(MediaRouterMojoImplTest, PresentationConnectionStateChangedCallback) { | 1083 TEST_F(MediaRouterMojoImplTest, PresentationConnectionStateChangedCallback) { |
1084 MediaRoute::Id route_id("route-id"); | 1084 MediaRoute::Id route_id("route-id"); |
1085 const std::string kPresentationUrl("http://foo.fakeUrl"); | 1085 const GURL presentation_url("http://www.example.com/presentation.html"); |
1086 const std::string kPresentationId("pid"); | 1086 const std::string kPresentationId("pid"); |
1087 content::PresentationSessionInfo connection(kPresentationUrl, | 1087 content::PresentationSessionInfo connection(presentation_url, |
1088 kPresentationId); | 1088 kPresentationId); |
1089 MockPresentationConnectionStateChangedCallback callback; | 1089 MockPresentationConnectionStateChangedCallback callback; |
1090 std::unique_ptr<PresentationConnectionStateSubscription> subscription = | 1090 std::unique_ptr<PresentationConnectionStateSubscription> subscription = |
1091 router()->AddPresentationConnectionStateChangedCallback( | 1091 router()->AddPresentationConnectionStateChangedCallback( |
1092 route_id, | 1092 route_id, |
1093 base::Bind(&MockPresentationConnectionStateChangedCallback::Run, | 1093 base::Bind(&MockPresentationConnectionStateChangedCallback::Run, |
1094 base::Unretained(&callback))); | 1094 base::Unretained(&callback))); |
1095 | 1095 |
1096 { | 1096 { |
1097 base::RunLoop run_loop; | 1097 base::RunLoop run_loop; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 EXPECT_CALL(mock_media_route_provider_, | 1565 EXPECT_CALL(mock_media_route_provider_, |
1566 UpdateMediaSinks(MediaSourceForDesktop().id())) | 1566 UpdateMediaSinks(MediaSourceForDesktop().id())) |
1567 .WillOnce(InvokeWithoutArgs([&run_loop2]() { | 1567 .WillOnce(InvokeWithoutArgs([&run_loop2]() { |
1568 run_loop2.Quit(); | 1568 run_loop2.Quit(); |
1569 })); | 1569 })); |
1570 | 1570 |
1571 run_loop2.Run(); | 1571 run_loop2.Run(); |
1572 } | 1572 } |
1573 | 1573 |
1574 } // namespace media_router | 1574 } // namespace media_router |
OLD | NEW |