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

Commit

Permalink
Bug 1162384 - [NFC] Cannot share image which is opened from notificat…
Browse files Browse the repository at this point in the history
…ion, r=alive
  • Loading branch information
cctuan authored and rvandermeulen committed May 26, 2015
1 parent 922131e commit e6107c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/system/js/app_window.js
Original file line number Diff line number Diff line change
Expand Up @@ -1242,12 +1242,11 @@
AppWindow.prototype._showScreenshotOverlay =
function aw__showScreenshotOverlay() {
if (this.frontWindow && this.frontWindow.isActive()) {
this.frontWindow._showScreenshotOverlay();
return;
return this.frontWindow._showScreenshotOverlay();
}
if (!this.screenshotOverlay ||
this.screenshotOverlay.classList.contains('visible')) {
return;
return Promise.resolve();
}
if (this.identificationOverlay) {
this.element.classList.add('overlay');
Expand Down
10 changes: 10 additions & 0 deletions apps/system/test/unit/app_window_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,16 @@ suite('system/AppWindow', function() {
assert.isFalse(app2.screenshotOverlay.classList.contains('visible'));
});

test('should return promise and resolve directly if the frontest app is' +
' active and its screenshot is visible', function(done) {
app1.frontWindow = app2;
this.sinon.stub(app2, 'isActive').returns(true);
app2.screenshotOverlay.classList.add('visible');
app1._showScreenshotOverlay().then(() => {
done();
});
});

test('hideScreenshotOverlay', function() {
app1.screenshotOverlay.classList.add('visible');
app1.element.classList.add('overlay');
Expand Down

0 comments on commit e6107c7

Please sign in to comment.