This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24780 from KevinGrandon/bug_1077579_shb_permissio…
…n_prompt_sizing Bug 1077579 - [SoftwareHome] Add integration tests for permission dialog, coverage for bug 1074608
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
apps/system/test/marionette/software_home_permission_prompt_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
}); | ||
}); |