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: let { Loader } = require('sdk/test/loader'); michael@0: michael@0: exports.testReady = function(assert, done) { michael@0: let loader = Loader(module); michael@0: let { ready, window } = loader.require('sdk/addon/window'); michael@0: let windowIsReady = false; michael@0: michael@0: ready.then(function() { michael@0: assert.equal(windowIsReady, false, 'ready promise was resolved only once'); michael@0: windowIsReady = true; michael@0: michael@0: loader.unload(); michael@0: done(); michael@0: }).then(null, assert.fail); michael@0: } michael@0: michael@0: require('sdk/test').run(exports);