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

Unified Diff: device/vr/vr_device_manager_unittest.cc

Issue 2746233002: Fixes 2D-to-WebVR site transitions when browsing in VR. (Closed)
Patch Set: Fixed export 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 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_display_impl.h » ('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 4ca61ad24e8efc005b536ffc16913f709089bd32..f8d39f1ecd49aa33495caa64cffba4ad69e630ca 100644
--- a/device/vr/vr_device_manager_unittest.cc
+++ b/device/vr/vr_device_manager_unittest.cc
@@ -76,17 +76,15 @@ TEST_F(VRDeviceManagerTest, InitializationTest) {
// initialization. And SetClient method in VRService class will invoke
// GetVRDevices too.
auto service = BindService();
- device_manager_->GetVRDevices(service.get());
+ device_manager_->AddService(service.get());
EXPECT_TRUE(provider_->IsInitialized());
}
-TEST_F(VRDeviceManagerTest, GetDevicesBasicTest) {
+TEST_F(VRDeviceManagerTest, GetDevicesTest) {
auto service = BindService();
-
- bool success = device_manager_->GetVRDevices(service.get());
+ device_manager_->AddService(service.get());
// Calling GetVRDevices should initialize the providers.
EXPECT_TRUE(provider_->IsInitialized());
- EXPECT_FALSE(success);
// GetDeviceByIndex should return nullptr if an invalid index in queried.
VRDevice* queried_device = GetDevice(1);
@@ -94,16 +92,15 @@ TEST_F(VRDeviceManagerTest, GetDevicesBasicTest) {
FakeVRDevice* device1 = new FakeVRDevice();
provider_->AddDevice(base::WrapUnique(device1));
- success = device_manager_->GetVRDevices(service.get());
- EXPECT_TRUE(success);
+ // VRDeviceManager will query devices as a side effect.
+ service = BindService();
// Should have successfully returned one device.
EXPECT_EQ(device1, GetDevice(device1->id()));
FakeVRDevice* device2 = new FakeVRDevice();
provider_->AddDevice(base::WrapUnique(device2));
- success = device_manager_->GetVRDevices(service.get());
- EXPECT_TRUE(success);
-
+ // VRDeviceManager will query devices as a side effect.
+ service = BindService();
// Querying the WebVRDevice index should return the correct device.
EXPECT_EQ(device1, GetDevice(device1->id()));
EXPECT_EQ(device2, GetDevice(device2->id()));
« no previous file with comments | « device/vr/vr_device_manager.cc ('k') | device/vr/vr_display_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698