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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 | 1407 |
1408 profile_.reset(new TestingProfile); | 1408 profile_.reset(new TestingProfile); |
1409 // Set up a mock ProcessManager instance. | 1409 // Set up a mock ProcessManager instance. |
1410 extensions::ProcessManagerFactory::GetInstance()->SetTestingFactory( | 1410 extensions::ProcessManagerFactory::GetInstance()->SetTestingFactory( |
1411 profile_.get(), &TestProcessManager::Create); | 1411 profile_.get(), &TestProcessManager::Create); |
1412 process_manager_ = static_cast<TestProcessManager*>( | 1412 process_manager_ = static_cast<TestProcessManager*>( |
1413 extensions::ProcessManager::Get(profile_.get())); | 1413 extensions::ProcessManager::Get(profile_.get())); |
1414 DCHECK(process_manager_); | 1414 DCHECK(process_manager_); |
1415 | 1415 |
1416 // Create MR and its proxy, so that it can be accessed through Mojo. | 1416 // Create MR and its proxy, so that it can be accessed through Mojo. |
1417 media_router_.reset(new MediaRouterMojoImpl(process_manager_)); | 1417 media_router_.reset( |
| 1418 new MediaRouterMojoImpl(process_manager_, profile_.get())); |
1418 ProcessEventLoop(); | 1419 ProcessEventLoop(); |
1419 } | 1420 } |
1420 | 1421 |
1421 void TearDown() override { | 1422 void TearDown() override { |
1422 media_router_.reset(); | 1423 media_router_.reset(); |
1423 profile_.reset(); | 1424 profile_.reset(); |
1424 } | 1425 } |
1425 | 1426 |
1426 // Constructs bindings so that |media_router_| delegates calls to | 1427 // Constructs bindings so that |media_router_| delegates calls to |
1427 // |mojo_media_router_|, which are then handled by | 1428 // |mojo_media_router_|, which are then handled by |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 EXPECT_CALL(mock_media_route_provider_, | 1812 EXPECT_CALL(mock_media_route_provider_, |
1812 StartListeningForRouteMessages(media_source.id())); | 1813 StartListeningForRouteMessages(media_source.id())); |
1813 media_router_->OnConnectionError(); | 1814 media_router_->OnConnectionError(); |
1814 BindMediaRouteProvider(); | 1815 BindMediaRouteProvider(); |
1815 RegisterMediaRouteProvider(); | 1816 RegisterMediaRouteProvider(); |
1816 base::RunLoop().RunUntilIdle(); | 1817 base::RunLoop().RunUntilIdle(); |
1817 } | 1818 } |
1818 } | 1819 } |
1819 | 1820 |
1820 } // namespace media_router | 1821 } // namespace media_router |
OLD | NEW |