Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: device/vr/vr_display_impl_unittest.cc

Issue 2729523002: Re-land^2 WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Rebase to 11e28fd6b9380b77273db51ef0b6ccc7ea341944 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/vr/vr_display_impl.cc ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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? Currently,
51 // the FakeVRDisplay doesn't access the submit client, so a nullptr
52 // is ok.
53 device::mojom::VRSubmitFrameClientPtr submit_client = nullptr;
50 display_impl->RequestPresent( 54 display_impl->RequestPresent(
51 true, base::Bind(&VRDisplayImplTest::onPresentComplete, 55 true, std::move(submit_client),
52 base::Unretained(this))); 56 base::Bind(&VRDisplayImplTest::onPresentComplete,
57 base::Unretained(this)));
53 } 58 }
54 59
55 void ExitPresent(VRDisplayImpl* display_impl) { display_impl->ExitPresent(); } 60 void ExitPresent(VRDisplayImpl* display_impl) { display_impl->ExitPresent(); }
56 61
57 void TearDown() override { base::RunLoop().RunUntilIdle(); } 62 void TearDown() override { base::RunLoop().RunUntilIdle(); }
58 63
59 VRDevice* device() { return device_; } 64 VRDevice* device() { return device_; }
60 65
61 bool presenting() { return !!device_->presenting_display_; } 66 bool presenting() { return !!device_->presenting_display_; }
62 67
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 auto service_2 = BindService(); 121 auto service_2 = BindService();
117 122
118 device()->OnChanged(); 123 device()->OnChanged();
119 124
120 base::RunLoop().RunUntilIdle(); 125 base::RunLoop().RunUntilIdle();
121 126
122 for (auto* client : clients_) 127 for (auto* client : clients_)
123 EXPECT_TRUE(client->CheckDeviceId(device()->id())); 128 EXPECT_TRUE(client->CheckDeviceId(device()->id()));
124 } 129 }
125 } 130 }
OLDNEW
« no previous file with comments | « device/vr/vr_display_impl.cc ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698