tor-browser

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

test_MemoryActor_saveHeapSnapshot_03.js (705B)


      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 save full runtime heap snapshots when attached to the
      7 // ParentProcessTargetActor or a ContentProcessTargetActor.
      8 
      9 add_task(async () => {
     10  const { memoryFront } = await createMainProcessMemoryFront();
     11 
     12  const snapshotFilePath = await memoryFront.saveHeapSnapshot();
     13  ok(
     14    !!(await IOUtils.stat(snapshotFilePath)),
     15    "Should have the heap snapshot file"
     16  );
     17  const snapshot = ChromeUtils.readHeapSnapshot(snapshotFilePath);
     18  ok(
     19    HeapSnapshot.isInstance(snapshot),
     20    "And we should be able to read a HeapSnapshot instance from the file"
     21  );
     22 });