| 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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 | 1205 |
| 1206 profile_.reset(new TestingProfile); | 1206 profile_.reset(new TestingProfile); |
| 1207 // Set up a mock ProcessManager instance. | 1207 // Set up a mock ProcessManager instance. |
| 1208 extensions::ProcessManagerFactory::GetInstance()->SetTestingFactory( | 1208 extensions::ProcessManagerFactory::GetInstance()->SetTestingFactory( |
| 1209 profile_.get(), &TestProcessManager::Create); | 1209 profile_.get(), &TestProcessManager::Create); |
| 1210 process_manager_ = static_cast<TestProcessManager*>( | 1210 process_manager_ = static_cast<TestProcessManager*>( |
| 1211 extensions::ProcessManager::Get(profile_.get())); | 1211 extensions::ProcessManager::Get(profile_.get())); |
| 1212 DCHECK(process_manager_); | 1212 DCHECK(process_manager_); |
| 1213 | 1213 |
| 1214 // Create MR and its proxy, so that it can be accessed through Mojo. | 1214 // Create MR and its proxy, so that it can be accessed through Mojo. |
| 1215 media_router_.reset(new MediaRouterMojoImpl(process_manager_)); | 1215 media_router_.reset( |
| 1216 new MediaRouterMojoImpl(profile_.get(), process_manager_)); |
| 1216 ProcessEventLoop(); | 1217 ProcessEventLoop(); |
| 1217 } | 1218 } |
| 1218 | 1219 |
| 1219 void TearDown() override { | 1220 void TearDown() override { |
| 1220 media_router_.reset(); | 1221 media_router_.reset(); |
| 1221 profile_.reset(); | 1222 profile_.reset(); |
| 1222 } | 1223 } |
| 1223 | 1224 |
| 1224 // Constructs bindings so that |media_router_| delegates calls to | 1225 // Constructs bindings so that |media_router_| delegates calls to |
| 1225 // |mojo_media_router_|, which are then handled by | 1226 // |mojo_media_router_|, which are then handled by |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 EXPECT_CALL(mock_media_route_provider_, | 1561 EXPECT_CALL(mock_media_route_provider_, |
| 1561 UpdateMediaSinks(MediaSourceForDesktop().id())) | 1562 UpdateMediaSinks(MediaSourceForDesktop().id())) |
| 1562 .WillOnce(InvokeWithoutArgs([&run_loop2]() { | 1563 .WillOnce(InvokeWithoutArgs([&run_loop2]() { |
| 1563 run_loop2.Quit(); | 1564 run_loop2.Quit(); |
| 1564 })); | 1565 })); |
| 1565 | 1566 |
| 1566 run_loop2.Run(); | 1567 run_loop2.Run(); |
| 1567 } | 1568 } |
| 1568 | 1569 |
| 1569 } // namespace media_router | 1570 } // namespace media_router |
| OLD | NEW |