tor-browser

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

test_bug637286.js (810B)


      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 const { NetUtil } = ChromeUtils.importESModule(
      6  "resource://gre/modules/NetUtil.sys.mjs"
      7 );
      8 
      9 // Check that the zip cache can expire entries from nested jars
     10 
     11 function open_inner_zip(base, idx) {
     12  var spec = "jar:" + base + "inner" + idx + ".zip!/foo";
     13  var channel = NetUtil.newChannel({
     14    uri: spec,
     15    loadUsingSystemPrincipal: true,
     16  });
     17  channel.open();
     18 }
     19 
     20 function run_test() {
     21  var file = do_get_file("data/test_bug637286.zip");
     22  var outerJarBase = "jar:" + Services.io.newFileURI(file).spec + "!/";
     23 
     24  for (var i = 0; i < 40; i++) {
     25    open_inner_zip(outerJarBase, i);
     26    gc();
     27  }
     28 }