mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 12:19:05 +02:00
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36052 --HG-- extra : source : b5be5b4f4b47c256e28a29f665dc754f6407ee7f
39 lines
950 B
JavaScript
39 lines
950 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
"use strict";
|
|
|
|
function run_test() {
|
|
let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
|
|
let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].getService(
|
|
Ci.nsIMemoryReporterManager
|
|
);
|
|
|
|
let ok = gfxInfo.controlGPUProcessForXPCShell(true);
|
|
Assert.equal(ok, true);
|
|
|
|
let endTesting = function() {
|
|
gfxInfo.controlGPUProcessForXPCShell(false);
|
|
do_test_finished();
|
|
};
|
|
|
|
let foundGPUProcess = false;
|
|
let onHandleReport = function(
|
|
aProcess,
|
|
aPath,
|
|
aKind,
|
|
aUnits,
|
|
aAmount,
|
|
aDescription
|
|
) {
|
|
if (/GPU \(pid \d+\)/.test(aProcess)) {
|
|
foundGPUProcess = true;
|
|
}
|
|
};
|
|
let onFinishReporting = function() {
|
|
Assert.equal(foundGPUProcess, true);
|
|
endTesting();
|
|
};
|
|
|
|
mgr.getReports(onHandleReport, null, onFinishReporting, null, false);
|
|
do_test_pending();
|
|
}
|