Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
38
gaia/apps/verticalhome/test/marionette/lib/launch_icon.js
Executable file
38
gaia/apps/verticalhome/test/marionette/lib/launch_icon.js
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
/* global module */
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
Launches an icon (which may be a real app launch or download retry)
|
||||
|
||||
@param {Marionette.Element} element of particular icon.
|
||||
*/
|
||||
module.exports = function launchIcon(element) {
|
||||
// XXX: work around focus issues by ensuring we clicked the thing
|
||||
element.scriptWith(function(e) {
|
||||
e.scrollIntoView(false);
|
||||
e.__ensureClick__ = function() {
|
||||
e.removeEventListener('click', e.__ensureClick__);
|
||||
e.setAttribute('data-test-was-clicked', true);
|
||||
};
|
||||
e.addEventListener('click', e.__ensureClick__);
|
||||
});
|
||||
|
||||
element.client.waitFor(function() {
|
||||
// try to click it
|
||||
element.tap();
|
||||
|
||||
return element.scriptWith(function(e) {
|
||||
// if it was clicked clear the state if we want to run this again
|
||||
if (e.getAttribute('data-test-was-clicked')) {
|
||||
e.removeEventListener('click', e.__ensureClick__);
|
||||
e.removeAttribute('data-test-was-clicked');
|
||||
return true;
|
||||
}
|
||||
|
||||
// otherwise try again
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
Reference in a new issue