tor-browser

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

test_MemoryActor_saveHeapSnapshot_02.js (675B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test that we can properly stream heap snapshot files over the RDP as bulk
      7 // data.
      8 
      9 add_task(async () => {
     10  const { memoryFront } = await createTabMemoryFront();
     11 
     12  const snapshotFilePath = await memoryFront.saveHeapSnapshot({
     13    forceCopy: true,
     14  });
     15  ok(
     16    !!(await IOUtils.stat(snapshotFilePath)),
     17    "Should have the heap snapshot file"
     18  );
     19  const snapshot = ChromeUtils.readHeapSnapshot(snapshotFilePath);
     20  ok(
     21    HeapSnapshot.isInstance(snapshot),
     22    "And we should be able to read a HeapSnapshot instance from the file"
     23  );
     24 });