tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

font_access_permission.tentative.https.window.js (1073B)


      1 // META: script=/resources/testdriver.js
      2 // META: script=/resources/testdriver-vendor.js
      3 // META: timeout=long
      4 
      5 'use strict';
      6 
      7 promise_test(async t => {
      8  await test_driver.bless('enable local font queries');
      9  const fonts = await self.queryLocalFonts();
     10  assert_equals(
     11      fonts.length, 0, 'Fonts are not returned with permission not given.');
     12 }, 'queryLocalFonts(): permission not given');
     13 
     14 promise_test(async t => {
     15  await test_driver.set_permission({name: 'local-fonts'}, 'denied');
     16  await test_driver.bless('enable local font queries');
     17  const fonts = await self.queryLocalFonts();
     18  assert_equals(
     19      fonts.length, 0, 'Fonts are not returned with permission denied.');
     20 }, 'queryLocalFonts(): permission denied');
     21 
     22 promise_test(async t => {
     23  await test_driver.set_permission({name: 'local-fonts'}, 'granted');
     24  await test_driver.bless('enable local font queries');
     25  const fonts = await self.queryLocalFonts();
     26  assert_greater_than_equal(
     27      fonts.length, 1, 'Fonts are returned with permission granted.');
     28 }, 'queryLocalFonts(): permission granted');