| 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 "device/vr/vr_display_impl.h" | 5 #include "device/vr/vr_display_impl.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "device/vr/test/fake_vr_device.h" | 9 #include "device/vr/test/fake_vr_device.h" |
| 10 #include "device/vr/test/fake_vr_device_provider.h" | 10 #include "device/vr/test/fake_vr_device_provider.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 protected: | 29 protected: |
| 30 void SetUp() override { | 30 void SetUp() override { |
| 31 provider_ = new FakeVRDeviceProvider(); | 31 provider_ = new FakeVRDeviceProvider(); |
| 32 device_ = new FakeVRDevice(); | 32 device_ = new FakeVRDevice(); |
| 33 provider_->AddDevice(base::WrapUnique(device_)); | 33 provider_->AddDevice(base::WrapUnique(device_)); |
| 34 device_manager_.reset(new VRDeviceManager(base::WrapUnique(provider_))); | 34 device_manager_.reset(new VRDeviceManager(base::WrapUnique(provider_))); |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::unique_ptr<VRServiceImpl> BindService() { | 37 std::unique_ptr<VRServiceImpl> BindService() { |
| 38 mojom::VRServiceClientPtr proxy; | 38 mojom::VRServiceClientPtr proxy; |
| 39 clients_.push_back(new FakeVRServiceClient(mojo::GetProxy(&proxy))); | 39 clients_.push_back(new FakeVRServiceClient(mojo::MakeRequest(&proxy))); |
| 40 | 40 |
| 41 auto service = base::WrapUnique(new VRServiceImpl()); | 41 auto service = base::WrapUnique(new VRServiceImpl()); |
| 42 service->SetClient(std::move(proxy), | 42 service->SetClient(std::move(proxy), |
| 43 base::Bind(&VRDisplayImplTest::onDisplaySynced, | 43 base::Bind(&VRDisplayImplTest::onDisplaySynced, |
| 44 base::Unretained(this))); | 44 base::Unretained(this))); |
| 45 return service; | 45 return service; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void RequestPresent(VRDisplayImpl* display_impl) { | 48 void RequestPresent(VRDisplayImpl* display_impl) { |
| 49 display_impl->RequestPresent( | 49 display_impl->RequestPresent( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 auto service_2 = BindService(); | 115 auto service_2 = BindService(); |
| 116 | 116 |
| 117 device()->OnChanged(); | 117 device()->OnChanged(); |
| 118 | 118 |
| 119 base::RunLoop().RunUntilIdle(); | 119 base::RunLoop().RunUntilIdle(); |
| 120 | 120 |
| 121 for (auto client : clients_) | 121 for (auto client : clients_) |
| 122 EXPECT_TRUE(client->CheckDeviceId(device()->id())); | 122 EXPECT_TRUE(client->CheckDeviceId(device()->id())); |
| 123 } | 123 } |
| 124 } | 124 } |
| OLD | NEW |