Bug 1024774 - Part 10: Add an xpcshell test for reading heap snapshots. r=jimb

This commit is contained in:
Nick Fitzgerald 2015-05-28 07:37:43 -07:00
parent 1bd1513bea
commit 887d7debc4
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,22 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Test that we can read core dumps into HeapSnapshot instances.
const { addDebuggerToGlobal } = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
var Debugger;
addDebuggerToGlobal(this);
function run_test() {
const filePath = getFilePath("core-dump.tmp", true, true);
ok(filePath, "Should get a file path");
ChromeUtils.saveHeapSnapshot(filePath, { globals: [this] });
ok(true, "Should be able to save a snapshot.");
const snapshot = ChromeUtils.readHeapSnapshot(filePath);
ok(snapshot, "Should be able to read a heap snapshot");
ok(snapshot instanceof HeapSnapshot, "Should be an instanceof HeapSnapshot");
do_test_finished();
}

View File

@ -41,6 +41,7 @@ support-files =
[test_getyoungestframe.js]
[test_nsjsinspector.js]
[test_SaveHeapSnapshot.js]
[test_ReadHeapSnapshot.js]
[test_dbgactor.js]
[test_dbgglobal.js]
[test_dbgclient_debuggerstatement.js]