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 "device/vr/vr_device_manager.h" | 5 #include "device/vr/vr_device_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 VRDeviceManagerTest::~VRDeviceManagerTest() {} | 53 VRDeviceManagerTest::~VRDeviceManagerTest() {} |
54 | 54 |
55 void VRDeviceManagerTest::SetUp() { | 55 void VRDeviceManagerTest::SetUp() { |
56 provider_ = new FakeVRDeviceProvider(); | 56 provider_ = new FakeVRDeviceProvider(); |
57 device_manager_.reset(new VRDeviceManager(base::WrapUnique(provider_))); | 57 device_manager_.reset(new VRDeviceManager(base::WrapUnique(provider_))); |
58 } | 58 } |
59 | 59 |
60 std::unique_ptr<VRServiceImpl> VRDeviceManagerTest::BindService() { | 60 std::unique_ptr<VRServiceImpl> VRDeviceManagerTest::BindService() { |
61 mojom::VRServiceClientPtr proxy; | 61 mojom::VRServiceClientPtr proxy; |
62 FakeVRServiceClient client(mojo::GetProxy(&proxy)); | 62 FakeVRServiceClient client(mojo::MakeRequest(&proxy)); |
63 auto service = base::WrapUnique(new VRServiceImpl()); | 63 auto service = base::WrapUnique(new VRServiceImpl()); |
64 service->SetClient(std::move(proxy), | 64 service->SetClient(std::move(proxy), |
65 base::Bind(&VRDeviceManagerTest::onDisplaySynced, | 65 base::Bind(&VRDeviceManagerTest::onDisplaySynced, |
66 base::Unretained(this))); | 66 base::Unretained(this))); |
67 return service; | 67 return service; |
68 } | 68 } |
69 | 69 |
70 TEST_F(VRDeviceManagerTest, InitializationTest) { | 70 TEST_F(VRDeviceManagerTest, InitializationTest) { |
71 EXPECT_FALSE(provider_->IsInitialized()); | 71 EXPECT_FALSE(provider_->IsInitialized()); |
72 | 72 |
(...skipping 30 matching lines...) Expand all Loading... |
103 provider_->AddDevice(base::WrapUnique(device2)); | 103 provider_->AddDevice(base::WrapUnique(device2)); |
104 success = device_manager_->GetVRDevices(service.get()); | 104 success = device_manager_->GetVRDevices(service.get()); |
105 EXPECT_TRUE(success); | 105 EXPECT_TRUE(success); |
106 | 106 |
107 // Querying the WebVRDevice index should return the correct device. | 107 // Querying the WebVRDevice index should return the correct device. |
108 EXPECT_EQ(device1, GetDevice(device1->id())); | 108 EXPECT_EQ(device1, GetDevice(device1->id())); |
109 EXPECT_EQ(device2, GetDevice(device2->id())); | 109 EXPECT_EQ(device2, GetDevice(device2->id())); |
110 } | 110 } |
111 | 111 |
112 } // namespace device | 112 } // namespace device |
OLD | NEW |