forked from mirrors/gecko-dev
Automatic update from web-platform-tests [idle] Add a threshold minimum of 60 seconds in IdleDetector This change adds a minimum threshold of 60 seconds to prevent sites from observing user signals such as typing cadence, or identifying users with physical or cognitive imparments that may require more time to interact with user agents and content. Bug: 939883 Change-Id: I3ab19b2f7d6711c14356575d338819f501eafb9a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535286 Commit-Queue: Ayu Ishii <ayui@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#643965} -- wpt-commits: ea7981d4c3eb888bcc3d19b0270937c06b92e4f6 wpt-pr: 16033
36 lines
875 B
JavaScript
36 lines
875 B
JavaScript
// META: script=/resources/WebIDLParser.js
|
|
// META: script=/resources/idlharness.js
|
|
|
|
// https://github.com/samuelgoto/idle-detection
|
|
|
|
'use strict';
|
|
|
|
promise_test(async (t) => {
|
|
const srcs = ['./idle-detection.idl',
|
|
'/interfaces/dom.idl',
|
|
'/interfaces/html.idl'];
|
|
|
|
const [idle, dom, html] = await Promise.all(
|
|
srcs.map(i => fetch(i).then(r => r.text()))
|
|
);
|
|
|
|
const idl_array = new IdlArray();
|
|
idl_array.add_idls(idle);
|
|
idl_array.add_dependency_idls(dom);
|
|
idl_array.add_dependency_idls(html);
|
|
|
|
self.idle = new IdleDetector({threshold: 60});
|
|
|
|
let watcher = new EventWatcher(t, self.idle, ["change"]);
|
|
|
|
self.idle.start();
|
|
|
|
await watcher.wait_for("change");
|
|
|
|
idl_array.add_objects({
|
|
IdleDetector: ['idle'],
|
|
IdleState: ['idle.state']
|
|
});
|
|
|
|
idl_array.test();
|
|
}, 'Test IDL implementation of Idle Detection API');
|