| 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 EXPECT_CALL(sink_handler, Invoke(kSinkId2)).Times(1); | 1138 EXPECT_CALL(sink_handler, Invoke(kSinkId2)).Times(1); |
| 1139 MediaSinkSearchResponseCallback sink_callback = base::Bind( | 1139 MediaSinkSearchResponseCallback sink_callback = base::Bind( |
| 1140 &SinkResponseCallbackHandler::Invoke, base::Unretained(&sink_handler)); | 1140 &SinkResponseCallbackHandler::Invoke, base::Unretained(&sink_handler)); |
| 1141 | 1141 |
| 1142 router()->SearchSinks(kSinkId, kSource, search_input, domain, sink_callback); | 1142 router()->SearchSinks(kSinkId, kSource, search_input, domain, sink_callback); |
| 1143 | 1143 |
| 1144 base::RunLoop run_loop; | 1144 base::RunLoop run_loop; |
| 1145 run_loop.RunUntilIdle(); | 1145 run_loop.RunUntilIdle(); |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 TEST_F(MediaRouterMojoImplTest, ProvideSinks) { |
| 1149 std::vector<MediaSinkInternal> sinks; |
| 1150 MediaSink sink(kSinkId, kSinkName, MediaSink::IconType::CAST); |
| 1151 CastSinkExtraData extra_data; |
| 1152 EXPECT_TRUE(extra_data.ip_address.AssignFromIPLiteral("192.168.1.3")); |
| 1153 extra_data.capabilities = 2; |
| 1154 extra_data.cast_channel_id = 3; |
| 1155 MediaSinkInternal expected_sink(sink, extra_data); |
| 1156 sinks.push_back(expected_sink); |
| 1157 std::string provider_name = "cast"; |
| 1158 |
| 1159 EXPECT_CALL(mock_media_route_provider_, ProvideSinks(provider_name, sinks)); |
| 1160 |
| 1161 router()->ProvideSinks(provider_name, sinks); |
| 1162 |
| 1163 base::RunLoop run_loop; |
| 1164 run_loop.RunUntilIdle(); |
| 1165 } |
| 1166 |
| 1148 class MediaRouterMojoExtensionTest : public ::testing::Test { | 1167 class MediaRouterMojoExtensionTest : public ::testing::Test { |
| 1149 public: | 1168 public: |
| 1150 MediaRouterMojoExtensionTest() : process_manager_(nullptr) {} | 1169 MediaRouterMojoExtensionTest() : process_manager_(nullptr) {} |
| 1151 | 1170 |
| 1152 ~MediaRouterMojoExtensionTest() override {} | 1171 ~MediaRouterMojoExtensionTest() override {} |
| 1153 | 1172 |
| 1154 protected: | 1173 protected: |
| 1155 void SetUp() override { | 1174 void SetUp() override { |
| 1156 // Set the extension's version number to be identical to the browser's. | 1175 // Set the extension's version number to be identical to the browser's. |
| 1157 extension_ = | 1176 extension_ = |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 EXPECT_CALL(mock_media_route_provider_, | 1537 EXPECT_CALL(mock_media_route_provider_, |
| 1519 UpdateMediaSinks(MediaSourceForDesktop().id())) | 1538 UpdateMediaSinks(MediaSourceForDesktop().id())) |
| 1520 .WillOnce(InvokeWithoutArgs([&run_loop2]() { | 1539 .WillOnce(InvokeWithoutArgs([&run_loop2]() { |
| 1521 run_loop2.Quit(); | 1540 run_loop2.Quit(); |
| 1522 })); | 1541 })); |
| 1523 | 1542 |
| 1524 run_loop2.Run(); | 1543 run_loop2.Run(); |
| 1525 } | 1544 } |
| 1526 | 1545 |
| 1527 } // namespace media_router | 1546 } // namespace media_router |
| OLD | NEW |