tor-browser

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

browser_514751.js (992B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 add_task(async function test_malformedURI() {
      6  /** Test for Bug 514751 (Wallpaper) */
      7 
      8  let state = {
      9    windows: [
     10      {
     11        tabs: [
     12          {
     13            entries: [
     14              {
     15                url: "about:mozilla",
     16                triggeringPrincipal_base64,
     17                title: "Mozilla",
     18              },
     19              {},
     20            ],
     21          },
     22        ],
     23      },
     24    ],
     25  };
     26 
     27  var theWin = openDialog(location, "", "chrome,all,dialog=no");
     28  await promiseWindowLoaded(theWin);
     29 
     30  var gotError = false;
     31  try {
     32    await setWindowState(theWin, state, true);
     33  } catch (e) {
     34    if (/NS_ERROR_MALFORMED_URI/.test(e)) {
     35      gotError = true;
     36    }
     37  }
     38 
     39  ok(!gotError, "Didn't get a malformed URI error.");
     40  await BrowserTestUtils.closeWindow(theWin);
     41 });