tor-browser

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

test_asyncbadremove.js (765B)


      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 
      6 const FILENAME = "missing.txt";
      7 
      8 var observer = {
      9  onStartRequest() {},
     10 
     11  onStopRequest(request, status) {
     12    Assert.equal(status, Cr.NS_ERROR_FILE_NOT_FOUND);
     13    zipW.close();
     14    Assert.equal(ZIP_EOCDR_HEADER_SIZE, tmpFile.fileSize);
     15    do_test_finished();
     16  },
     17 };
     18 
     19 function run_test() {
     20  zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
     21  zipW.removeEntry(FILENAME, true);
     22  do_test_pending();
     23  zipW.processQueue(observer, null);
     24 
     25  // With nothing to actually do the queue would have completed immediately
     26  Assert.ok(!zipW.inQueue);
     27 }