Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20547 from alivedise/bugzilla/1023812_master/find…
Browse files Browse the repository at this point in the history
…-bottom-most-window-to-open-or-close

Bug 1023812 - Find bottom most window to do open/close operation when ac...r=timdream
  • Loading branch information
alivedise authored and rvandermeulen committed Jun 24, 2014
1 parent 25b9076 commit 4654a62
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/system/js/app_window.js
Expand Up @@ -766,10 +766,12 @@
// as window disposition activity.
if (this.isActive() && this.callerWindow) {
var caller = this.callerWindow;
var callerBottom = caller.getBottomMostWindow();
var calleeBottom = this.getBottomMostWindow();
caller.calleeWindow = null;
this.callerWindow = null;
caller.open('in-from-left');
this.close('out-to-right');
callerBottom.open('in-from-left');
calleeBottom.close('out-to-right');
}
};

Expand Down
21 changes: 21 additions & 0 deletions apps/system/test/unit/app_window_test.js
Expand Up @@ -1145,6 +1145,27 @@ suite('system/AppWindow', function() {
assert.isTrue(spyClose.calledWith('out-to-right'));
});

test('We should open the base window if we are not', function() {
var app1 = new AppWindow(fakeAppConfig1);
var app1Base = new AppWindow(fakeAppConfig2);
var app2 = new AppWindow(fakeAppConfig2);
var spyOpen = this.sinon.spy(app1Base, 'open');
var spyClose = this.sinon.spy(app2, 'close');
app1.CLASS_NAME = 'ActivityWindow';

var stubIsActive = this.sinon.stub(app2, 'isActive');
app1Base.calleeWindow = app2;
app2.callerWindow = app1Base;
stubIsActive.returns(true);

app2.handleEvent({
type: 'mozbrowseractivitydone'
});

assert.isTrue(spyOpen.calledWith('in-from-left'));
assert.isTrue(spyClose.calledWith('out-to-right'));
});

test('Error event', function() {
var app1 = new AppWindow(fakeAppConfig1);
var stubKill = this.sinon.stub(app1, 'kill');
Expand Down

0 comments on commit 4654a62

Please sign in to comment.