Commit 53e2581d authored by Alexander Cooper's avatar Alexander Cooper Committed by Commit Bot

Make //device/vr:fakes a component

This converts the //device/vr:fakes static_library to a component. This
means that it can be included without needing to define
"DEVICE_VR_IMPLEMENTATION."

Change-Id: Ice6145301893c730109a4b7dd3432d2a366729a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131212
Commit-Queue: Piotr Bialecki <bialpio@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarPiotr Bialecki <bialpio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755409}
parent 1a7df948
...@@ -255,7 +255,7 @@ test("vr_android_unittests") { ...@@ -255,7 +255,7 @@ test("vr_android_unittests") {
"//base/test:test_support", "//base/test:test_support",
"//chrome/browser", "//chrome/browser",
"//components/translate/core/language_detection:language_detection", "//components/translate/core/language_detection:language_detection",
"//device/vr:fakes", "//device/vr:vr_fakes",
"//device/vr/public/mojom", "//device/vr/public/mojom",
"//mojo/core/embedder", "//mojo/core/embedder",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
......
...@@ -490,11 +490,6 @@ test("vr_common_unittests") { ...@@ -490,11 +490,6 @@ test("vr_common_unittests") {
"vr_geometry_util_unittest.cc", "vr_geometry_util_unittest.cc",
] ]
# TODO(mthiesse, crbug.com/769373): The dependency on device/vr:fakes requires
# some workarounds for tests, since we are static-linking to the fakes instead
# of loading them from a dll on Windows.
defines = [ "DEVICE_VR_IMPLEMENTATION" ]
deps = [ deps = [
":vr_test_support", ":vr_test_support",
"//chrome/browser", "//chrome/browser",
...@@ -595,7 +590,7 @@ source_set("vr_test_support") { ...@@ -595,7 +590,7 @@ source_set("vr_test_support") {
"//ui/gfx:test_support", "//ui/gfx:test_support",
# TODO(mthiesse, crbug.com/769373): Remove dependency on device/vr:fakes. # TODO(mthiesse, crbug.com/769373): Remove dependency on device/vr:fakes.
"//device/vr:fakes", "//device/vr:vr_fakes",
# TODO(cjgrant): Figure out why including //ui/android:ui_java here # TODO(cjgrant): Figure out why including //ui/android:ui_java here
# doesn't propagate to individual test executable targets. # doesn't propagate to individual test executable targets.
......
...@@ -333,7 +333,7 @@ test("device_unittests") { ...@@ -333,7 +333,7 @@ test("device_unittests") {
deps += [ deps += [
"//device/vr", "//device/vr",
"//device/vr:fakes", "//device/vr:vr_fakes",
"//device/vr/public/mojom", "//device/vr/public/mojom",
"//services/device/public/cpp/generic_sensor", "//services/device/public/cpp/generic_sensor",
"//ui/display", "//ui/display",
......
...@@ -245,7 +245,7 @@ if (enable_vr) { ...@@ -245,7 +245,7 @@ if (enable_vr) {
} }
} }
static_library("fakes") { component("vr_fakes") {
testonly = true testonly = true
defines = [ "DEVICE_VR_IMPLEMENTATION" ] defines = [ "DEVICE_VR_IMPLEMENTATION" ]
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
#ifndef DEVICE_VR_TEST_FAKE_ORIENTATION_PROVIDER_H_ #ifndef DEVICE_VR_TEST_FAKE_ORIENTATION_PROVIDER_H_
#define DEVICE_VR_TEST_FAKE_ORIENTATION_PROVIDER_H_ #define DEVICE_VR_TEST_FAKE_ORIENTATION_PROVIDER_H_
#include "device/vr/vr_export.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
#include "services/device/public/mojom/sensor.mojom.h" #include "services/device/public/mojom/sensor.mojom.h"
namespace device { namespace device {
class FakeOrientationSensor : public mojom::Sensor { class DEVICE_VR_EXPORT FakeOrientationSensor : public mojom::Sensor {
public: public:
FakeOrientationSensor(mojo::PendingReceiver<mojom::Sensor> receiver); FakeOrientationSensor(mojo::PendingReceiver<mojom::Sensor> receiver);
~FakeOrientationSensor() override; ~FakeOrientationSensor() override;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef DEVICE_VR_TEST_FAKE_SENSOR_PROVIDER_H_ #ifndef DEVICE_VR_TEST_FAKE_SENSOR_PROVIDER_H_
#define DEVICE_VR_TEST_FAKE_SENSOR_PROVIDER_H_ #define DEVICE_VR_TEST_FAKE_SENSOR_PROVIDER_H_
#include "device/vr/vr_export.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
#include "services/device/public/mojom/sensor.mojom.h" #include "services/device/public/mojom/sensor.mojom.h"
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
namespace device { namespace device {
class FakeXRSensorProvider : public mojom::SensorProvider { class DEVICE_VR_EXPORT FakeXRSensorProvider : public mojom::SensorProvider {
public: public:
FakeXRSensorProvider(); FakeXRSensorProvider();
explicit FakeXRSensorProvider( explicit FakeXRSensorProvider(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment