| 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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "device/vr/test/fake_vr_device.h" | 10 #include "device/vr/test/fake_vr_device.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 clients_.push_back(new FakeVRServiceClient(mojo::MakeRequest(&proxy))); | 40 clients_.push_back(new FakeVRServiceClient(mojo::MakeRequest(&proxy))); |
| 41 | 41 |
| 42 auto service = base::WrapUnique(new VRServiceImpl()); | 42 auto service = base::WrapUnique(new VRServiceImpl()); |
| 43 service->SetClient(std::move(proxy), | 43 service->SetClient(std::move(proxy), |
| 44 base::Bind(&VRDisplayImplTest::onDisplaySynced, | 44 base::Bind(&VRDisplayImplTest::onDisplaySynced, |
| 45 base::Unretained(this))); | 45 base::Unretained(this))); |
| 46 return service; | 46 return service; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void RequestPresent(VRDisplayImpl* display_impl) { | 49 void RequestPresent(VRDisplayImpl* display_impl) { |
| 50 // TODO(klausw,mthiesse): set up a VRSubmitFrameClient here. |
| 51 device::mojom::VRSubmitFrameClientPtr submit_client = nullptr; |
| 50 display_impl->RequestPresent( | 52 display_impl->RequestPresent( |
| 51 true, base::Bind(&VRDisplayImplTest::onPresentComplete, | 53 true, std::move(submit_client), |
| 52 base::Unretained(this))); | 54 base::Bind(&VRDisplayImplTest::onPresentComplete, |
| 55 base::Unretained(this))); |
| 53 } | 56 } |
| 54 | 57 |
| 55 void ExitPresent(VRDisplayImpl* display_impl) { display_impl->ExitPresent(); } | 58 void ExitPresent(VRDisplayImpl* display_impl) { display_impl->ExitPresent(); } |
| 56 | 59 |
| 57 void TearDown() override { base::RunLoop().RunUntilIdle(); } | 60 void TearDown() override { base::RunLoop().RunUntilIdle(); } |
| 58 | 61 |
| 59 VRDevice* device() { return device_; } | 62 VRDevice* device() { return device_; } |
| 60 | 63 |
| 61 bool presenting() { return !!device_->presenting_display_; } | 64 bool presenting() { return !!device_->presenting_display_; } |
| 62 | 65 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 auto service_2 = BindService(); | 119 auto service_2 = BindService(); |
| 117 | 120 |
| 118 device()->OnChanged(); | 121 device()->OnChanged(); |
| 119 | 122 |
| 120 base::RunLoop().RunUntilIdle(); | 123 base::RunLoop().RunUntilIdle(); |
| 121 | 124 |
| 122 for (auto* client : clients_) | 125 for (auto* client : clients_) |
| 123 EXPECT_TRUE(client->CheckDeviceId(device()->id())); | 126 EXPECT_TRUE(client->CheckDeviceId(device()->id())); |
| 124 } | 127 } |
| 125 } | 128 } |
| OLD | NEW |