tor-browser

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

browser_jsonview_ignore_charset.js (605B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 add_task(async function () {
      7  info("Test ignored charset parameter started");
      8 
      9  const encodedChar = "%E2%9D%A4"; // In UTF-8 this is a heavy black heart
     10  const result = "❤";
     11  const TEST_JSON_URL = "data:application/json;charset=ANSI," + encodedChar;
     12 
     13  await addJsonViewTab(TEST_JSON_URL);
     14  await selectJsonViewContentTab("rawdata");
     15 
     16  const text = await getElementText(".textPanelBox .data");
     17  is(text, result, "The charset parameter is ignored and UTF-8 is used.");
     18 });