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

Unified Diff: device/vr/vr_device_manager_unittest.cc

Issue 2329893002: Isolate a presenting VR device from pages other than the one presenting. (Closed)
Patch Set: Unit tests Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/vr/vr_device_manager.cc ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_device_manager_unittest.cc
diff --git a/device/vr/vr_device_manager_unittest.cc b/device/vr/vr_device_manager_unittest.cc
index fe178f225d400a71661d59685343078141f3d386..454f6c4b41fb0ab3a99e37cbc5dab326909f4fee 100644
--- a/device/vr/vr_device_manager_unittest.cc
+++ b/device/vr/vr_device_manager_unittest.cc
@@ -25,6 +25,10 @@ class VRDeviceManagerTest : public testing::Test {
bool HasServiceInstance() { return VRDeviceManager::HasInstance(); }
+ VRDevice* GetDevice(unsigned int index) {
+ return device_manager_->GetDevice(index);
+ }
+
protected:
FakeVRDeviceProvider* provider_;
std::unique_ptr<VRDeviceManager> device_manager_;
@@ -63,7 +67,7 @@ TEST_F(VRDeviceManagerTest, GetDevicesBasicTest) {
EXPECT_EQ(0u, webvr_devices.size());
// GetDeviceByIndex should return nullptr if an invalid index in queried.
- VRDevice* queried_device = device_manager_->GetDevice(1);
+ VRDevice* queried_device = GetDevice(1);
EXPECT_EQ(nullptr, queried_device);
std::unique_ptr<FakeVRDevice> device1(new FakeVRDevice(provider_));
@@ -82,9 +86,9 @@ TEST_F(VRDeviceManagerTest, GetDevicesBasicTest) {
// NOTE: Returned WebVRDevices are not required to be in any particular order.
// Querying the WebVRDevice index should return the correct device.
- queried_device = device_manager_->GetDevice(device1->id());
+ queried_device = GetDevice(device1->id());
EXPECT_EQ(device1.get(), queried_device);
- queried_device = device_manager_->GetDevice(device2->id());
+ queried_device = GetDevice(device2->id());
EXPECT_EQ(device2.get(), queried_device);
provider_->RemoveDevice(device1.get());
« no previous file with comments | « device/vr/vr_device_manager.cc ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698