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 #25643 from mancas/bug956902
Browse files Browse the repository at this point in the history
Bug 956902 - [B2G][First Time Experience] User is able to access and bec...
  • Loading branch information
rvandermeulen committed Nov 3, 2014
2 parents cebd567 + 95beaa6 commit 5f3126b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/system/js/utility_tray.js
Expand Up @@ -125,7 +125,7 @@ var UtilityTray = {
break;

case 'touchstart':
if (lockScreen.locked) {
if (lockScreen.locked || FtuLauncher.isFtuRunning()) {
return;
}

Expand Down
15 changes: 14 additions & 1 deletion apps/system/test/unit/utility_tray_test.js
Expand Up @@ -3,10 +3,12 @@
requireApp('system/shared/test/unit/mocks/mock_lazy_loader.js');
requireApp('system/test/unit/mock_app_window_manager.js');
requireApp('system/test/unit/mock_lock_screen.js');
requireApp('system/test/unit/mock_ftu_launcher.js');

var mocksHelperForUtilityTray = new MocksHelper([
'AppWindowManager',
'LazyLoader'
'LazyLoader',
'FtuLauncher'
]);
mocksHelperForUtilityTray.init();

Expand Down Expand Up @@ -321,6 +323,10 @@ suite('system/UtilityTray', function() {
fakeEvt.touches = [0];
});

teardown(function() {
MockFtuLauncher.mIsRunning = false;
});

test('onTouchStart is not called if LockScreen is locked', function() {
window.lockScreen.locked = true;
var stub = this.sinon.stub(UtilityTray, 'onTouchStart');
Expand Down Expand Up @@ -352,6 +358,13 @@ suite('system/UtilityTray', function() {
it works in local test but breaks in travis. */
// assert.equal(UtilityTray.active, true);
});

test('onTouchStart is called when ftu is running', function() {
MockFtuLauncher.mIsRunning = true;
var stub = this.sinon.stub(UtilityTray, 'onTouchStart');
UtilityTray.handleEvent(fakeEvt);
assert.ok(stub.notCalled);
});
});

suite('handleEvent: touchend', function() {
Expand Down

0 comments on commit 5f3126b

Please sign in to comment.