Skip to content

Instantly share code, notes, and snippets.

@darkowlzz
Created May 2, 2013 04:45
Show Gist options
  • Save darkowlzz/5500188 to your computer and use it in GitHub Desktop.
Save darkowlzz/5500188 to your computer and use it in GitHub Desktop.
let { promise } = require('sdk/window/helpers');
console.log("foo1");
promise(open('chrome://foo/content/'), 'load').then(function(window) {
console.log("foo2");
assert.ok(~windows().indexOf(window), 'chrome URI works');
console.log("foo3");
return window; // pass window to next function
}).then(close).
then(promise.bind(null, 'resource://foo', 'load')).then(function(window) {
assert.ok(~windows().indexOf(window), 'resource URI works');
console.log("foo4");
return window;
}).then(close).then(done);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment