test-addon-window.js 667 B

12345678910111213141516171819202122
  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. let { Loader } = require('sdk/test/loader');
  6. exports.testReady = function(assert, done) {
  7. let loader = Loader(module);
  8. let { ready, window } = loader.require('sdk/addon/window');
  9. let windowIsReady = false;
  10. ready.then(function() {
  11. assert.equal(windowIsReady, false, 'ready promise was resolved only once');
  12. windowIsReady = true;
  13. loader.unload();
  14. done();
  15. }).then(null, assert.fail);
  16. }
  17. require('sdk/test').run(exports);