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

Unified Diff: chrome/browser/permissions/permission_manager_unittest.cc

Issue 2975593002: [vr] Deny permission requests in VR mode
Patch Set: . Created 3 years, 5 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
Index: chrome/browser/permissions/permission_manager_unittest.cc
diff --git a/chrome/browser/permissions/permission_manager_unittest.cc b/chrome/browser/permissions/permission_manager_unittest.cc
index b5911d6bc2c7c08ab6532ce4cb866a91300cb220..212d1af1397c99f883980633e26f326744d25431 100644
--- a/chrome/browser/permissions/permission_manager_unittest.cc
+++ b/chrome/browser/permissions/permission_manager_unittest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/permissions/permission_request_manager.h"
#include "chrome/browser/permissions/permission_result.h"
#include "chrome/browser/ui/permission_bubble/mock_permission_prompt_factory.h"
+#include "chrome/browser/vr/vr_tab_helper.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -19,18 +20,12 @@
#include "device/vr/features/features.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
-#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
-#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
-
using blink::mojom::PermissionStatus;
using content::PermissionType;
namespace {
-#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
int kNoPendingOperation = -1;
-#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
class PermissionManagerTestingProfile final : public TestingProfile {
public:
@@ -406,10 +401,9 @@ TEST_F(PermissionManagerTest, SubscribeMIDIPermission) {
GetPermissionManager()->UnsubscribePermissionStatusChange(subscription_id);
}
-#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
TEST_F(PermissionManagerTest, SuppressPermissionRequests) {
content::WebContents* contents = web_contents();
- vr_shell::VrTabHelper::CreateForWebContents(contents);
+ vr::VrTabHelper::CreateForWebContents(contents);
NavigateAndCommit(url());
SetPermission(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_ALLOW);
@@ -420,8 +414,7 @@ TEST_F(PermissionManagerTest, SuppressPermissionRequests) {
EXPECT_TRUE(callback_called());
EXPECT_EQ(PermissionStatus::GRANTED, callback_result());
- vr_shell::VrTabHelper* vr_tab_helper =
- vr_shell::VrTabHelper::FromWebContents(contents);
+ vr::VrTabHelper* vr_tab_helper = vr::VrTabHelper::FromWebContents(contents);
vr_tab_helper->SetIsInVr(true);
EXPECT_EQ(
kNoPendingOperation,
@@ -440,7 +433,6 @@ TEST_F(PermissionManagerTest, SuppressPermissionRequests) {
EXPECT_TRUE(callback_called());
EXPECT_EQ(PermissionStatus::GRANTED, callback_result());
}
-#endif // BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
TEST_F(PermissionManagerTest, PermissionIgnoredCleanup) {
content::WebContents* contents = web_contents();
« no previous file with comments | « chrome/browser/permissions/permission_manager.cc ('k') | chrome/browser/ui/android/login_handler_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698