| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/media/router/offscreen_presentation_manager.h" | 9 #include "chrome/browser/media/router/offscreen_presentation_manager.h" |
| 10 #include "chrome/browser/media/router/test_helper.h" | 10 #include "chrome/browser/media/router/test_helper.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 EXPECT_CALL(receiver_callback2, OnReceiverConnectionAvailableRaw(_, _)) | 291 EXPECT_CALL(receiver_callback2, OnReceiverConnectionAvailableRaw(_, _)) |
| 292 .Times(1); | 292 .Times(1); |
| 293 RegisterReceiver(kPresentationId2, receiver_callback2); | 293 RegisterReceiver(kPresentationId2, receiver_callback2); |
| 294 | 294 |
| 295 VerifyPresentationsSize(2); | 295 VerifyPresentationsSize(2); |
| 296 | 296 |
| 297 UnregisterReceiver(); | 297 UnregisterReceiver(); |
| 298 VerifyPresentationsSize(1); | 298 VerifyPresentationsSize(1); |
| 299 } | 299 } |
| 300 | 300 |
| 301 TEST_F(OffscreenPresentationManagerTest, TestIsOffscreenPresentation) { |
| 302 EXPECT_FALSE(manager()->IsOffscreenPresentation(kPresentationId)); |
| 303 content::PresentationConnectionPtr controller1; |
| 304 RegisterController(kPresentationId, std::move(controller1)); |
| 305 EXPECT_TRUE(manager()->IsOffscreenPresentation(kPresentationId)); |
| 306 } |
| 307 |
| 308 TEST_F(OffscreenPresentationManagerTest, TestRegisterAndGetRoute) { |
| 309 MediaSource source("source_1"); |
| 310 MediaRoute route("route_1", source, "sink_1", "", false, "", false); |
| 311 |
| 312 EXPECT_FALSE(manager()->GetRoute(kPresentationId)); |
| 313 manager()->RegisterOffscreenPresentationRoute(kPresentationId, |
| 314 GURL(kPresentationUrl), route); |
| 315 auto* actual_route = manager()->GetRoute(kPresentationId); |
| 316 EXPECT_TRUE(actual_route); |
| 317 EXPECT_TRUE(route.Equals(*actual_route)); |
| 318 } |
| 319 |
| 301 } // namespace media_router | 320 } // namespace media_router |
| OLD | NEW |