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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 url::Origin(GURL(kOrigin)))); | 690 url::Origin(GURL(kOrigin)))); |
691 EXPECT_TRUE(unrelated_sinks_observer->Init()); | 691 EXPECT_TRUE(unrelated_sinks_observer->Init()); |
692 ProcessEventLoop(); | 692 ProcessEventLoop(); |
693 | 693 |
694 std::vector<MediaSink> expected_sinks; | 694 std::vector<MediaSink> expected_sinks; |
695 expected_sinks.push_back( | 695 expected_sinks.push_back( |
696 MediaSink(kSinkId, kSinkName, MediaSink::IconType::CAST)); | 696 MediaSink(kSinkId, kSinkName, MediaSink::IconType::CAST)); |
697 expected_sinks.push_back( | 697 expected_sinks.push_back( |
698 MediaSink(kSinkId2, kSinkName, MediaSink::IconType::CAST)); | 698 MediaSink(kSinkId2, kSinkName, MediaSink::IconType::CAST)); |
699 | 699 |
| 700 std::vector<MediaSinkInternal> sinks; |
| 701 sinks.push_back(MediaSinkInternal(expected_sinks[0])); |
| 702 sinks.push_back(MediaSinkInternal(expected_sinks[1])); |
| 703 |
700 base::RunLoop run_loop; | 704 base::RunLoop run_loop; |
701 EXPECT_CALL(*sinks_observer, OnSinksReceived(SequenceEquals(expected_sinks))); | 705 EXPECT_CALL(*sinks_observer, OnSinksReceived(SequenceEquals(expected_sinks))); |
702 EXPECT_CALL(*extra_sinks_observer, | 706 EXPECT_CALL(*extra_sinks_observer, |
703 OnSinksReceived(SequenceEquals(expected_sinks))) | 707 OnSinksReceived(SequenceEquals(expected_sinks))) |
704 .WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); | 708 .WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); |
705 media_router_proxy_->OnSinksReceived( | 709 media_router_proxy_->OnSinksReceived( |
706 media_source.id(), expected_sinks, | 710 media_source.id(), sinks, |
707 std::vector<url::Origin>(1, url::Origin(GURL(kOrigin)))); | 711 std::vector<url::Origin>(1, url::Origin(GURL(kOrigin)))); |
708 run_loop.Run(); | 712 run_loop.Run(); |
709 | 713 |
710 // Since the MediaRouterMojoImpl has already received results for | 714 // Since the MediaRouterMojoImpl has already received results for |
711 // |media_source|, return cached results to observers that are subsequently | 715 // |media_source|, return cached results to observers that are subsequently |
712 // registered. | 716 // registered. |
713 std::unique_ptr<MockMediaSinksObserver> cached_sinks_observer( | 717 std::unique_ptr<MockMediaSinksObserver> cached_sinks_observer( |
714 new MockMediaSinksObserver(router(), media_source, | 718 new MockMediaSinksObserver(router(), media_source, |
715 url::Origin(GURL(kOrigin)))); | 719 url::Origin(GURL(kOrigin)))); |
716 EXPECT_CALL(*cached_sinks_observer, | 720 EXPECT_CALL(*cached_sinks_observer, |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 EXPECT_CALL(mock_media_route_provider_, | 1575 EXPECT_CALL(mock_media_route_provider_, |
1572 UpdateMediaSinks(MediaSourceForDesktop().id())) | 1576 UpdateMediaSinks(MediaSourceForDesktop().id())) |
1573 .WillOnce(InvokeWithoutArgs([&run_loop2]() { | 1577 .WillOnce(InvokeWithoutArgs([&run_loop2]() { |
1574 run_loop2.Quit(); | 1578 run_loop2.Quit(); |
1575 })); | 1579 })); |
1576 | 1580 |
1577 run_loop2.Run(); | 1581 run_loop2.Run(); |
1578 } | 1582 } |
1579 | 1583 |
1580 } // namespace media_router | 1584 } // namespace media_router |
OLD | NEW |