test-system-runtime.js 932 B

1234567891011121314151617181920212223
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. var runtime = require("sdk/system/runtime");
  6. exports["test system runtime"] = function(assert) {
  7. assert.equal(typeof(runtime.inSafeMode), "boolean",
  8. "inSafeMode is boolean");
  9. assert.equal(typeof(runtime.OS), "string",
  10. "runtime.OS is string");
  11. assert.equal(typeof(runtime.processType), "number",
  12. "runtime.processType is a number");
  13. assert.equal(typeof(runtime.widgetToolkit), "string",
  14. "runtime.widgetToolkit is string");
  15. var XPCOMABI = typeof(runtime.XPCOMABI);
  16. assert.ok(XPCOMABI === null || typeof(XPCOMABI) === "string",
  17. "runtime.XPCOMABI is string or null if not supported by platform");
  18. };
  19. require("test").run(exports);