tor-browser

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

browser_application_panel_list-unicode.js (1447B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const TAB_URL = (
      7  URL_ROOT + "resources/service-workers/simple-unicode.html"
      8 ).replace("example.com", "xn--hxajbheg2az3al.xn--jxalpdlp");
      9 
     10 /**
     11 * Check that the application panel displays filenames and URL's in human-readable,
     12 * Unicode characters, and not encoded URI's or punycode.
     13 */
     14 
     15 add_task(async function () {
     16  await enableApplicationPanel();
     17 
     18  const { panel, tab, commands } = await openNewTabAndApplicationPanel(TAB_URL);
     19  const doc = panel.panelWin.document;
     20 
     21  selectPage(panel, "service-workers");
     22 
     23  info("Wait until the service worker appears in the application panel");
     24  await waitUntil(() => getWorkerContainers(doc).length === 1);
     25 
     26  const workerContainer = getWorkerContainers(doc)[0];
     27 
     28  const scopeEl = workerContainer.querySelector(".js-sw-scope");
     29  ok(
     30    scopeEl.textContent.startsWith(
     31      "\u03C0\u03B1\u03C1\u03AC\u03B4\u03B5\u03B9\u03B3\u03BC\u03B1." +
     32        "\u03B4\u03BF\u03BA\u03B9\u03BC\u03AE"
     33    ),
     34    "Service worker has the expected Unicode scope"
     35  );
     36  const urlEl = workerContainer.querySelector(".js-source-url");
     37  ok(
     38    urlEl.textContent.endsWith("\u65E5\u672C"),
     39    "Service worker has the expected Unicode url"
     40  );
     41 
     42  await unregisterAllWorkers(commands.client, doc);
     43 
     44  // close the tab
     45  info("Closing the tab.");
     46  await BrowserTestUtils.removeTab(tab);
     47 });