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 #24426 from albertopq/1071706-dark-lockscreen
Browse files Browse the repository at this point in the history
Bug 1071706 - Dark icons on lockscreen r=kgrandon
  • Loading branch information
albertopq committed Sep 26, 2014
2 parents 4e9aa22 + f5061d5 commit 5df75bd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/system/js/statusbar.js
Expand Up @@ -520,6 +520,12 @@ var StatusBar = {
},

setAppearance: function(app) {
// Avoid any attempt to update the statusbar when
// the phone is locked
if (this.isLocked()) {
return;
}

this.element.classList.toggle('light',
!!(app.appChrome && app.appChrome.useLightTheming())
);
Expand Down
22 changes: 22 additions & 0 deletions apps/system/test/unit/statusbar_test.js
Expand Up @@ -1976,6 +1976,11 @@ suite('system/Statusbar', function() {
});

suite('setAppearance', function() {
setup(function() {
StatusBar.element.classList.remove('light');
StatusBar.element.classList.remove('maximized');
});

test('setAppearance light and maximized', function() {
StatusBar.setAppearance({
appChrome: {
Expand Down Expand Up @@ -2004,6 +2009,23 @@ suite('system/Statusbar', function() {
assert.isFalse(StatusBar.element.classList.contains('light'));
assert.isTrue(StatusBar.element.classList.contains('maximized'));
});

test('should do nothing if the phone is locked', function() {
System.locked = true;
StatusBar.setAppearance({
appChrome: {
useLightTheming: function useLightTheming() {
return true;
},
isMaximized: function isMaximized() {
return true;
}
}
});
assert.isFalse(StatusBar.element.classList.contains('light'));
assert.isFalse(StatusBar.element.classList.contains('maximized'));
System.locked = false;
});
});

suite('updateSignalIcon', function() {
Expand Down

0 comments on commit 5df75bd

Please sign in to comment.