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

Unified Diff: device/vr/vr_display_impl_unittest.cc

Issue 2537723002: Refine VRDevice Class (Closed)
Patch Set: Rebase Created 4 years 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_display_impl.cc ('k') | device/vr/vr_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_display_impl_unittest.cc
diff --git a/device/vr/vr_display_impl_unittest.cc b/device/vr/vr_display_impl_unittest.cc
index 1b59fc5994f22043c9cab3d625e5c36b91440549..7230e50f7cf74d4a924764d6388b1b91f9930fa4 100644
--- a/device/vr/vr_display_impl_unittest.cc
+++ b/device/vr/vr_display_impl_unittest.cc
@@ -57,7 +57,7 @@ class VRDisplayImplTest : public testing::Test {
VRDevice* device() { return device_; }
- bool presenting() { return !!device_->presenting_service_; }
+ bool presenting() { return !!device_->presenting_display_; }
base::MessageLoop message_loop_;
bool is_request_presenting_success_ = false;
@@ -73,13 +73,13 @@ TEST_F(VRDisplayImplTest, DevicePresentationIsolation) {
auto service_1 = BindService();
auto service_2 = BindService();
- // When not presenting either service should be able to access the device.
- EXPECT_TRUE(device()->IsAccessAllowed(service_1.get()));
- EXPECT_TRUE(device()->IsAccessAllowed(service_2.get()));
-
VRDisplayImpl* display_1 = service_1->GetVRDisplayImpl(device());
VRDisplayImpl* display_2 = service_2->GetVRDisplayImpl(device());
+ // When not presenting either service should be able to access the device.
+ EXPECT_TRUE(device()->IsAccessAllowed(display_1));
+ EXPECT_TRUE(device()->IsAccessAllowed(display_2));
+
// Begin presenting to the fake device with service 1.
RequestPresent(display_1);
EXPECT_TRUE(is_request_presenting_success_);
@@ -89,8 +89,8 @@ TEST_F(VRDisplayImplTest, DevicePresentationIsolation) {
// is still presenting.
RequestPresent(display_2);
EXPECT_FALSE(is_request_presenting_success_);
- EXPECT_TRUE(device()->IsAccessAllowed(service_1.get()));
- EXPECT_FALSE(device()->IsAccessAllowed(service_2.get()));
+ EXPECT_TRUE(device()->IsAccessAllowed(display_1));
+ EXPECT_FALSE(device()->IsAccessAllowed(display_2));
// Service 2 should not be able to exit presentation to the device.
ExitPresent(display_2);
@@ -102,8 +102,8 @@ TEST_F(VRDisplayImplTest, DevicePresentationIsolation) {
// Once presentation had ended both services should be able to access the
// device.
- EXPECT_TRUE(device()->IsAccessAllowed(service_1.get()));
- EXPECT_TRUE(device()->IsAccessAllowed(service_2.get()));
+ EXPECT_TRUE(device()->IsAccessAllowed(display_1));
+ EXPECT_TRUE(device()->IsAccessAllowed(display_2));
}
// This test case tests VRDevice class default behaviour when it
« no previous file with comments | « device/vr/vr_display_impl.cc ('k') | device/vr/vr_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698