Bug 1849657 - Changed consumed check for transient user activation to use lastUserGestureTimeStamp. r=bvandersloot,anti-tracking-reviewers DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D187121
This commit is contained in:
Harshit Sohaney 2023-08-31 13:29:54 +00:00
Родитель abf52e18ac
Коммит eae6af8066
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -40,6 +40,8 @@ async function requestStorageAccessAndExpectUserActivationActive() {
// Callback function to check if the user activation was consumed
async function requestStorageAccessAndExpectUserActivationConsumed() {
SpecialPowers.wrap(document).notifyUserGestureActivation();
const lastUserGesture = SpecialPowers.wrap(document).lastUserGestureTimeStamp;
let p = document.requestStorageAccess();
try {
await p;
@ -54,8 +56,8 @@ async function requestStorageAccessAndExpectUserActivationConsumed() {
`check has-been-user-activated on the top-level-document`
);
is(
SpecialPowers.wrap(document).hasValidTransientUserGestureActivation,
false,
SpecialPowers.wrap(document).lastUserGestureTimeStamp,
lastUserGesture,
`check has-valid-transient-user-activation on the top-level-document`
);