Skip to content

Commit

Permalink
[FedCM] Don't allow popups for mediation:silent or without user gesture
Browse files Browse the repository at this point in the history
Bug: 324452564
Change-Id: I16971fae3a0d2e97f3d2dabb8ed4fbf46ce9436b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5366099
Commit-Queue: Christian Biesinger <[email protected]>
Reviewed-by: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1273519}
  • Loading branch information
cbiesinger authored and chromium-wpt-export-bot committed Mar 15, 2024
1 parent 08c2f13 commit 49f8dd4
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<title>Federated Credential Management API network request tests.</title>
<link rel="help" href="https://fedidcg.github.io/FedCM">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<body>

<script type="module">
import {fedcm_test,
request_options_with_mediation_required,
select_manifest,
fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js';

fedcm_test(async t => {
// First, do a regular fedcm request so we that we can be considered
// a returning user below.
let options = request_options_with_mediation_required();
await fedcm_get_and_select_first_account(t, options);

// Now do a silent mediation request.
options = request_options_with_mediation_required('manifest_with_continue_on.json');
options.mediation = 'silent';
await select_manifest(t, options);
const cred_promise = fedcm_get_and_select_first_account(t, options);
return promise_rejects_dom(t, 'NetworkError', cred_promise);
}, "continue_on with mediation:silent should fail");

</script>

0 comments on commit 49f8dd4

Please sign in to comment.