mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1024774 - Part 10: Add an xpcshell test for reading heap snapshots. r=jimb
This commit is contained in:
parent
34cf66f165
commit
00b02845b9
22
toolkit/devtools/server/tests/unit/test_ReadHeapSnapshot.js
Normal file
22
toolkit/devtools/server/tests/unit/test_ReadHeapSnapshot.js
Normal 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();
|
||||
}
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user