Automatic update from web-platform-tests Reland "[Built-In APIs] Enable kAIRelaxUserActivationReqs by default." This is a reland of commit 145c695c20b8f2d96f8238633cf45624ca0439a0 Original change's description: > [Built-In APIs] Enable kAIRelaxUserActivationReqs by default. > > This change enables the AIRelaxUserActivationReqs feature flag by > default, relaxing user activation requirements for Built-In AI APIs. The > virtual test suite and associated tests designed to verify behavior when > this feature was disabled have been removed. Existing user activation > tests are updated to reflect that user activation is now present during > the test execution. > > Bug: 454435239 > Change-Id: Ic4b56d6e09bc8ca91f29619faaad409ba9b9c9ca > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7186624 > Reviewed-by: Reilly Grant <reillyg@chromium.org> > Reviewed-by: Nathan Memmott <memmott@chromium.org> > Reviewed-by: Kent Tamura <tkent@chromium.org> > Commit-Queue: Isaac Ahouma <iahouma@google.com> > Cr-Commit-Position: refs/heads/main@{#1550111} Bug: 454435239 Change-Id: Ib5d7e20377af9d6c7f460e97b4fb6264ffafa529 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7212760 Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Nathan Memmott <memmott@chromium.org> Cr-Commit-Position: refs/heads/main@{#1552994} -- wpt-commits: 5425a3bf8bee66750a2b3b352788e7db0ca8817f wpt-pr: 56430
26 lines
1.2 KiB
JavaScript
26 lines
1.2 KiB
JavaScript
// META: title=Summarizer Create User Activation
|
|
// META: script=/resources/testdriver.js
|
|
// META: script=../resources/util.js
|
|
// META: timeout=long
|
|
|
|
'use strict';
|
|
|
|
// Mocked model download state may be shared between test cases in the same file
|
|
// (see e.g. `EchoAIManagerImpl`), so this test case is kept in a separate file.
|
|
// TODO(crbug.com/390246212): Support model state controls for WPTs.
|
|
promise_test(async t => {
|
|
// Create requires user activation when availability is 'downloadable'.
|
|
assert_implements_optional(await Summarizer.availability() == 'downloadable');
|
|
assert_false(navigator.userActivation.isActive);
|
|
await promise_rejects_dom(t, 'NotAllowedError', Summarizer.create());
|
|
await test_driver.bless('Summarizer.create', Summarizer.create);
|
|
// User activation is not consumed by the create call.
|
|
assert_true(navigator.userActivation.isActive);
|
|
consumeTransientUserActivation();
|
|
|
|
// Create does not require transient user activation.
|
|
assert_equals(await Summarizer.availability(), 'available');
|
|
assert_false(navigator.userActivation.isActive);
|
|
await Summarizer.create();
|
|
}, 'Create requires sticky user activation when availability is "downloadable"');
|