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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 | 1413 |
1414 profile_.reset(new TestingProfile); | 1414 profile_.reset(new TestingProfile); |
1415 // Set up a mock ProcessManager instance. | 1415 // Set up a mock ProcessManager instance. |
1416 extensions::ProcessManagerFactory::GetInstance()->SetTestingFactory( | 1416 extensions::ProcessManagerFactory::GetInstance()->SetTestingFactory( |
1417 profile_.get(), &TestProcessManager::Create); | 1417 profile_.get(), &TestProcessManager::Create); |
1418 process_manager_ = static_cast<TestProcessManager*>( | 1418 process_manager_ = static_cast<TestProcessManager*>( |
1419 extensions::ProcessManager::Get(profile_.get())); | 1419 extensions::ProcessManager::Get(profile_.get())); |
1420 DCHECK(process_manager_); | 1420 DCHECK(process_manager_); |
1421 | 1421 |
1422 // Create MR and its proxy, so that it can be accessed through Mojo. | 1422 // Create MR and its proxy, so that it can be accessed through Mojo. |
1423 media_router_.reset(new MediaRouterMojoImpl(process_manager_)); | 1423 media_router_.reset( |
| 1424 new MediaRouterMojoImpl(process_manager_, profile_.get())); |
1424 ProcessEventLoop(); | 1425 ProcessEventLoop(); |
1425 } | 1426 } |
1426 | 1427 |
1427 void TearDown() override { | 1428 void TearDown() override { |
1428 media_router_.reset(); | 1429 media_router_.reset(); |
1429 profile_.reset(); | 1430 profile_.reset(); |
1430 } | 1431 } |
1431 | 1432 |
1432 // Constructs bindings so that |media_router_| delegates calls to | 1433 // Constructs bindings so that |media_router_| delegates calls to |
1433 // |mojo_media_router_|, which are then handled by | 1434 // |mojo_media_router_|, which are then handled by |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 EXPECT_CALL(mock_media_route_provider_, | 1824 EXPECT_CALL(mock_media_route_provider_, |
1824 StartListeningForRouteMessages(media_source.id())); | 1825 StartListeningForRouteMessages(media_source.id())); |
1825 media_router_->OnConnectionError(); | 1826 media_router_->OnConnectionError(); |
1826 BindMediaRouteProvider(); | 1827 BindMediaRouteProvider(); |
1827 RegisterMediaRouteProvider(); | 1828 RegisterMediaRouteProvider(); |
1828 base::RunLoop().RunUntilIdle(); | 1829 base::RunLoop().RunUntilIdle(); |
1829 } | 1830 } |
1830 } | 1831 } |
1831 | 1832 |
1832 } // namespace media_router | 1833 } // namespace media_router |
OLD | NEW |