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 #24780 from KevinGrandon/bug_1077579_shb_permissio…
Browse files Browse the repository at this point in the history
…n_prompt_sizing

Bug 1077579 - [SoftwareHome] Add integration tests for permission dialog, coverage for bug 1074608
  • Loading branch information
KevinGrandon committed Oct 6, 2014
2 parents 83de447 + 3317396 commit 39b0d0e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/system/style/permission_manager/permission_manager.css
Expand Up @@ -20,6 +20,12 @@
}
}

@media (orientation: portrait) {
#screen.software-button-enabled #permission-screen .generic-dialog[role="dialog"] {
bottom: 0;
}
}

#screen:-moz-full-screen-ancestor > #permission-screen,
#screen.fullscreen-app #permission-screen,
#screen.lockscreen-camera #permission-screen {
Expand All @@ -41,7 +47,7 @@
margin-top: var(--statusbar-height);
}

@media not all and (-moz-physical-home-button) {
@media all and (orientation: portrait) {
#screen:not(.software-button-disabled) #permission-screen {
height: calc(100% - var(--software-home-button-height));
}
Expand Down
@@ -0,0 +1,51 @@
'use strict';

var Home = require(
'../../../verticalhome/test/marionette/lib/home2');
var Rocketbar = require('./lib/rocketbar');
var System = require('./lib/system');

marionette('Software Home Button - Permission Prompt', function() {

var client = marionette.client({
prefs: {
'focusmanager.testmode': true,
'dom.w3c_touch_events.enabled': 1
},
settings: {
'ftu.manifestURL': null,
'lockscreen.enabled': false,
'software-button.enabled': true
}
});
var home, rocketbar, system;

setup(function() {
home = new Home(client);
rocketbar = new Rocketbar(client);
system = new System(client);
system.waitForStartup();
home.waitForLaunch();
client.switchToFrame();
});

test('Proper layout for the prompt', function() {

rocketbar.homescreenFocus();
rocketbar.enterText('a');

function rect(el) {
return el.getBoundingClientRect();
}

var winHeight = client.findElement('body').size().height;
client.waitFor(function() {
var dialog = client.helper.waitForElement('#permission-screen');
var dialogRect = dialog.scriptWith(rect);
var shbRect = system.softwareButtons.scriptWith(rect);

return dialogRect.bottom === shbRect.top &&
winHeight === (dialogRect.height + shbRect.height);
});
});
});

0 comments on commit 39b0d0e

Please sign in to comment.