Fonts Access: Remove prototype that uses a font picker.

Feedback from developers suggests that the font picker model is not a
useful block in building the experiences that folks are aiming to offer.
Therefore, we're consolidating our prototype around the permission
prompt model.

This CL also removes the FontAccessPersistent feature flag, because its
scope is now equivalent to the FontAccess flag.

Bug: 535764
Change-Id: I0e52562b55bbba4ef6d03c43ad2d988f8744f6bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3383599
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#960722}
diff --git a/font-access/font_access-chooser-multiple.tentative.manual.https.html b/font-access/font_access-chooser-multiple.tentative.manual.https.html
deleted file mode 100644
index bf70a0a..0000000
--- a/font-access/font_access-chooser-multiple.tentative.manual.https.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!doctype html>
-<title>Local Font Access: Multiple choosers</title>
-<meta charset=utf-8>
-
-<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>
-
-<script>
-  promise_test(async t => {
-    await new Promise(resolve => {
-      window.addEventListener('DOMContentLoaded', resolve);
-    });
-    // Small delay to give chrome's test automation a chance to actually install
-    // itself.
-    await new Promise(resolve => step_timeout(resolve, 100));
-
-    await window.test_driver.bless('show a font chooser.<br>Please select at least one font.');
-    const promise = navigator.fonts.query()
-    promise_rejects_dom(t, 'SecurityError', navigator.fonts.query());
-    const fonts = await promise;
-  }, 'query() multiple choosers');
-</script>
diff --git a/font-access/font_access-chooser-selection.tentative.manual.https.html b/font-access/font_access-chooser-selection.tentative.manual.https.html
deleted file mode 100644
index e8a1e8d..0000000
--- a/font-access/font_access-chooser-selection.tentative.manual.https.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!doctype html>
-<title>Local Font Access: Chooser, Selection Options</title>
-<meta charset=utf-8>
-
-<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>
-<script src="resources/test-expectations.js"></script>
-
-<script>
-    (async () => {
-      await new Promise(resolve => {
-        window.addEventListener('DOMContentLoaded', resolve);
-      });
-
-      // Small delay to give chrome's test automation a chance to actually install
-      // itself.
-      await new Promise(resolve => step_timeout(resolve, 100));
-
-      promise_test(async t => {
-        await window.test_driver.bless('show a font chooser.<br />Please select all the fonts that shows up.');
-        // Arial is considered to be web-safe.
-        const fonts = await navigator.fonts.query({select: ['ArialMT']});
-        assert_true(Array.isArray(fonts));
-        assert_equals(fonts.length, 1);
-
-        const postscriptName = fonts[0].postscriptName;
-        assert_equals(typeof postscriptName, "string");
-        assert_greater_than(postscriptName.length, 0);
-      }, 'query() with selection works');
-
-      promise_test(async t => {
-        await window.test_driver.bless('show a font chooser.<br />Please select all the fonts that shows up.');
-        const fonts = await navigator.fonts.query({select: []});
-        assert_true(Array.isArray(fonts));
-        assert_greater_than_equal(fonts.length, 1);
-
-        const postscriptName = fonts[0].postscriptName;
-        assert_equals(typeof postscriptName, "string");
-        assert_greater_than(postscriptName.length, 0);
-      }, 'query() with empty selection bag works');
-    })();
-</script>
diff --git a/font-access/font_access-chooser.tentative.manual.https.html b/font-access/font_access-chooser.tentative.manual.https.html
deleted file mode 100644
index 499d8be..0000000
--- a/font-access/font_access-chooser.tentative.manual.https.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!doctype html>
-<title>Local Font Access: Chooser</title>
-<meta charset=utf-8>
-
-<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>
-
-<script>
-  promise_test(async t => {
-    await new Promise(resolve => {
-      window.addEventListener('DOMContentLoaded', resolve);
-    });
-    // Small delay to give chrome's test automation a chance to actually install
-    // itself.
-    await new Promise(resolve => step_timeout(resolve, 100));
-
-    await window.test_driver.bless('show a font chooser.<br />Please select at least one font.');
-    const fonts = await navigator.fonts.query();
-    assert_true(Array.isArray(fonts));
-    assert_greater_than_equal(fonts.length, 1);
-
-    const postscriptName = fonts[0].postscriptName;
-    assert_equals(typeof postscriptName, "string");
-    assert_greater_than(postscriptName.length, 0);
-  }, 'query() with chooser works');
-
-</script>
diff --git a/font-access/font_metadata.tentative.https.window.js b/font-access/font_metadata.tentative.https.window.js
index 21d3ea1..672bc08 100644
--- a/font-access/font_metadata.tentative.https.window.js
+++ b/font-access/font_metadata.tentative.https.window.js
@@ -5,7 +5,7 @@
 'use strict';
 
 font_access_test(async t => {
-  const fonts = await navigator.fonts.query({persistentAccess: true});
+  const fonts = await navigator.fonts.query();
   assert_true(Array.isArray(fonts), 'Result of query() should be an Array');
   assert_greater_than_equal(fonts.length, 1, 'Need a least one font');
 
@@ -33,7 +33,7 @@
   const testSet = getEnumerationTestSet();
 
   // Get the system fonts.
-  let fonts = await navigator.fonts.query({persistentAccess: true});
+  let fonts = await navigator.fonts.query();
   assert_true(Array.isArray(fonts), 'Result of query() should be an Array');
 
   // Filter to the ones we care about.
diff --git a/font-access/resources/window-tests-blob.js b/font-access/resources/window-tests-blob.js
index e21733c..3279849 100644
--- a/font-access/resources/window-tests-blob.js
+++ b/font-access/resources/window-tests-blob.js
@@ -1,7 +1,7 @@
 'use strict';
 
 font_access_test(async t => {
-  const fonts = await navigator.fonts.query({persistentAccess: true});
+  const fonts = await navigator.fonts.query();
   const expectedFonts = await filterEnumeration(
       fonts, getEnumerationTestSet({labelFilter: [TEST_SIZE_CATEGORY.small]}));
   const additionalExpectedTables = getMoreExpectedTables(expectedFonts);
diff --git a/font-access/resources/window-tests-enumeration.js b/font-access/resources/window-tests-enumeration.js
index 838e5c3..be906f6 100644
--- a/font-access/resources/window-tests-enumeration.js
+++ b/font-access/resources/window-tests-enumeration.js
@@ -10,14 +10,14 @@
 
   font_access_test(async t => {
     const fonts =
-        await navigator.fonts.query({persistentAccess: true, ...test});
+        await navigator.fonts.query(test);
 
     assert_fonts_exist(fonts, getEnumerationTestSet());
   }, `query(): standard fonts returned for input: ${inputAsString}`);
 }
 
 font_access_test(async t => {
-  const fonts = await navigator.fonts.query({persistentAccess: true});
+  const fonts = await navigator.fonts.query();
   // The following tests that fonts are sorted. Postscript names are expected to
   // be encoded in a subset of the ASCII character set.
   // See: https://docs.microsoft.com/en-us/typography/opentype/spec/name
@@ -38,7 +38,6 @@
 
 font_access_test(async t => {
   const test = {
-    persistentAccess: true,
     select: [getEnumerationTestSet()[0].postscriptName]
   };
   const fonts = await navigator.fonts.query(test);
@@ -69,8 +68,7 @@
 
 for (const test of non_ascii_input) {
   font_access_test(async t => {
-    const fonts =
-        await navigator.fonts.query({persistentAccess: true, ...test});
+    const fonts = await navigator.fonts.query(test);
     assert_equals(
         fonts.length, 0,
         `There should be no results. Instead got: ${JSON.stringify(fonts)}`);