summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/font-access/font_access_permission.tentative.https.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/font-access/font_access_permission.tentative.https.window.js')
-rw-r--r--testing/web-platform/tests/font-access/font_access_permission.tentative.https.window.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/font-access/font_access_permission.tentative.https.window.js b/testing/web-platform/tests/font-access/font_access_permission.tentative.https.window.js
new file mode 100644
index 0000000000..cb7aabfc6b
--- /dev/null
+++ b/testing/web-platform/tests/font-access/font_access_permission.tentative.https.window.js
@@ -0,0 +1,24 @@
+//META: script=/resources/testdriver.js
+//META: script=/resources/testdriver-vendor.js
+
+'use strict';
+
+promise_test(async t => {
+ const fonts = await self.queryLocalFonts();
+ assert_equals(
+ fonts.length, 0, 'Fonts are not returned with permission not given.');
+}, 'queryLocalFonts(): permission not given');
+
+promise_test(async t => {
+ await test_driver.set_permission({name: 'local-fonts'}, 'denied');
+ const fonts = await self.queryLocalFonts();
+ assert_equals(
+ fonts.length, 0, 'Fonts are not returned with permission denied.');
+}, 'queryLocalFonts(): permission denied');
+
+promise_test(async t => {
+ await test_driver.set_permission({name: 'local-fonts'}, 'granted');
+ const fonts = await self.queryLocalFonts();
+ assert_greater_than_equal(
+ fonts.length, 1, 'Fonts are returned with permission granted.');
+}, 'queryLocalFonts(): permission granted');