Index: content/browser/vr/test/fake_vr_device.cc |
diff --git a/content/browser/vr/test/fake_vr_device.cc b/content/browser/vr/test/fake_vr_device.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c18dfdf0fe67ccc4ae5c12e5dc5b9cd2a7afa46e |
--- /dev/null |
+++ b/content/browser/vr/test/fake_vr_device.cc |
@@ -0,0 +1,55 @@ |
+// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/vr/test/fake_vr_device.h" |
+ |
+namespace content { |
+ |
+FakeVRDevice::FakeVRDevice(VRDeviceProvider* provider) |
+ : VRDevice(provider) { |
+} |
+ |
+FakeVRDevice::~FakeVRDevice() { |
+ |
+} |
+ |
+void FakeVRDevice::SetVRDevice(const blink::WebVRDevice& device) { |
+ device_ = device; |
+} |
+ |
+void FakeVRDevice::SetSensorState(const blink::WebHMDSensorState& state) { |
+ state_ = state; |
+} |
+ |
+void FakeVRDevice::SetRenderTargetSize( |
+ unsigned int width, |
+ unsigned int height) { |
+ width_ = width; |
+ height_ = height; |
+} |
+ |
+void FakeVRDevice::GetVRDevice(blink::WebVRDevice* device) { |
+ *device = device_; |
+} |
+ |
+void FakeVRDevice::GetSensorState(blink::WebHMDSensorState* state) { |
+ *state = state_; |
+} |
+void FakeVRDevice::GetRenderTargetRects( |
+ blink::WebVRFieldOfView leftFov, |
+ blink::WebVRFieldOfView rightFov, |
+ blink::WebVRVector4* leftRect, |
+ blink::WebVRVector4* rightRect) { |
+ leftRect->x = 0; |
+ leftRect->y = 0; |
+ leftRect->z = width_ / 2.0; |
+ leftRect->w = height_; |
+ |
+ rightRect->x = width_ / 2.0; |
+ rightRect->y = 0; |
+ rightRect->z = width_ / 2.0; |
+ rightRect->w = height_; |
+} |
+ |
+} // namespace content |