tor-browser

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

Memory-takeCensus-05.js (554B)


      1 // Test that Debugger.Memory.prototype.takeCensus finds cross compartment
      2 // wrapper GC roots.
      3 
      4 var g = newGlobal({newCompartment: true});
      5 var dbg = new Debugger(g);
      6 
      7 assertEq("AllocationMarker" in dbg.memory.takeCensus().objects, false,
      8         "There shouldn't exist any allocation markers in the census.");
      9 
     10 this.ccw = g.allocationMarker();
     11 
     12 assertEq(dbg.memory.takeCensus().objects.AllocationMarker.count, 1,
     13         "Should have one allocation marker in the census, because there " +
     14         "is one cross-compartment wrapper referring to it.");