New issue
Advanced search Search tips

Issue 922173 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Notification permission not cleared between instrumentation testcases

Project Member Reported by bsheedy@chromium.org, Jan 15

Issue description

Normally, permissions granted to a site are cleared between each testcase in the Android instrumentation tests. For example, running the following JavaScript will have the page request to use the camera:

navigator.getUserMedia({video: true})

Accepting the resulting permission prompt grants the site the permission to use the camera, but doing so in another testcase immediately after causes another permission prompt to be displayed.

Doing the same with the following JavaScript to request notification permissions yields different behavior:

Notification.requestPermission()

The first test to do so will get a permission prompt as expected, but all subsequent tests will retain the permission from the first and not get any permission prompts.

Tests are supposed to be hermetic, so the notification permission should be cleared between tests like every other permission type.
 
I've only been able to test this so far on a Pixel 2 with O, so this might be related to the way that the permission is stored https://cs.chromium.org/chromium/src/chrome/browser/notifications/notification_permission_context.h?q=notificationpermissioncontext&sq=package:chromium&dr=CSs&l=39

Sign in to add a comment