Finalized browser-window show & hide events, added tests & fixed os x implementation

This commit is contained in:
Arek Sredzki 2016-03-08 11:11:17 -08:00
parent c1267b2320
commit fcc1f4d7ed
4 changed files with 73 additions and 9 deletions

View file

@ -120,14 +120,55 @@ describe('browser-window module', function() {
});
describe('BrowserWindow.show()', function() {
it('should focus on window', function() {
if (isCI) {
return;
}
if (isCI) {
return;
}
it('should focus on window', function() {
w.show();
assert(w.isFocused());
});
it('should make the window visible', function() {
w.show();
assert(w.isVisible());
});
it('emits when window is shown', function(done) {
this.timeout(10000);
w.once('show', function() {
assert.equal(w.isVisible(), true);
done();
});
w.show();
});
});
describe('BrowserWindow.hide()', function() {
if (isCI) {
return;
}
it('should defocus on window', function() {
w.hide();
assert(!w.isFocused());
});
it('should make the window not visible', function() {
w.show();
w.hide();
assert(!w.isVisible());
});
it('emits when window is hidden', function(done) {
this.timeout(10000);
w.show();
w.once('hide', function() {
assert.equal(w.isVisible(), false);
done();
});
w.hide();
});
});
describe('BrowserWindow.showInactive()', function() {