gecko/services/healthreport/tests/xpcshell/test_provider_sysinfo.js
Gregory Szorc 6f789f2007 Bug 959356 - Report isWow64 in Firefox Health Report; r=bsmedberg
Previously, we weren't measuring whether the machine was 64-bit
properly. This change allows us to report actual CPU architecture (at
least on Windows).

In the future, we may wish to properly report actual CPU architecture on
all operating systems.

--HG--
extra : rebase_source : 73b5673e870e959a33172ec22fee8c31db6e0e53
extra : amend_source : 64d2e23be07aa87bc5c150b6e613e6226c848ec8
2014-01-17 09:25:39 -08:00

42 lines
1.0 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const {interfaces: Ci, results: Cr, utils: Cu} = Components;
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/services/healthreport/providers.jsm");
function run_test() {
run_next_test();
}
add_test(function test_constructor() {
let provider = new SysInfoProvider();
run_next_test();
});
add_task(function test_collect_smoketest() {
let storage = yield Metrics.Storage("collect_smoketest");
let provider = new SysInfoProvider();
yield provider.init(storage);
yield provider.collectConstantData();
let m = provider.getMeasurement("sysinfo", 2);
let data = yield storage.getMeasurementValues(m.id);
let serializer = m.serializer(m.SERIALIZE_JSON);
let d = serializer.singular(data.singular);
do_check_eq(d._v, 2);
do_check_true(d.cpuCount > 0);
do_check_neq(d.name, null);
yield storage.close();
});