michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: "use strict"; michael@0: michael@0: const runtime = require("sdk/system/runtime"); michael@0: const system = require("sdk/system"); michael@0: michael@0: exports["test system architecture and compiler"] = function(assert) { michael@0: michael@0: if (system.architecture !== null) { michael@0: assert.equal( michael@0: runtime.XPCOMABI.indexOf(system.architecture), 0, michael@0: "system.architecture is starting substring of runtime.XPCOMABI" michael@0: ); michael@0: } michael@0: michael@0: if (system.compiler !== null) { michael@0: assert.equal( michael@0: runtime.XPCOMABI.indexOf(system.compiler), michael@0: runtime.XPCOMABI.length - system.compiler.length, michael@0: "system.compiler is trailing substring of runtime.XPCOMABI" michael@0: ); michael@0: } michael@0: michael@0: assert.ok( michael@0: system.architecture === null || typeof(system.architecture) === "string", michael@0: "system.architecture is string or null if not supported by platform" michael@0: ); michael@0: michael@0: assert.ok( michael@0: system.compiler === null || typeof(system.compiler) === "string", michael@0: "system.compiler is string or null if not supported by platform" michael@0: ); michael@0: }; michael@0: michael@0: require("test").run(exports);