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
58
gaia/tests/jsmarionette/helper.js
Executable file
58
gaia/tests/jsmarionette/helper.js
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
'use strict';
|
||||
/* global module, require */
|
||||
|
||||
var fs = require('fs');
|
||||
|
||||
var Helper = {
|
||||
|
||||
unlockScreen: function(client) {
|
||||
// wait that the lockscreen is ready
|
||||
client.waitFor(function () {
|
||||
return client.executeScript(function () {
|
||||
if (!window || !window.wrappedJSObject.lockScreenWindowManager) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var wrappedObject = window.wrappedJSObject;
|
||||
var lockScreen = wrappedObject.lockScreen || wrappedObject.LockScreen;
|
||||
|
||||
return typeof lockScreen.unlock === 'function';
|
||||
});
|
||||
});
|
||||
client.executeScript(
|
||||
fs.readFileSync('./tests/atoms/gaia_lock_screen.js') +
|
||||
'GaiaLockScreen.unlock();\n');
|
||||
},
|
||||
|
||||
lockScreen: function(client) {
|
||||
// wait that the lockscreen is ready
|
||||
client.waitFor(function () {
|
||||
return client.executeScript(function () {
|
||||
if (!window || !window.wrappedJSObject.lockScreenWindowManager) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var wrappedObject = window.wrappedJSObject;
|
||||
var lockScreen = wrappedObject.lockScreen || wrappedObject.LockScreen;
|
||||
|
||||
return typeof lockScreen.lock === 'function';
|
||||
});
|
||||
});
|
||||
client.executeScript(
|
||||
fs.readFileSync('./tests/atoms/gaia_lock_screen.js') +
|
||||
'GaiaLockScreen.lock();\n');
|
||||
},
|
||||
|
||||
delay: function(client, interval, givenCallback) {
|
||||
var start = Date.now();
|
||||
client.waitFor(function(callback) {
|
||||
if (Date.now() - start >= interval) {
|
||||
callback(null, true);
|
||||
} else {
|
||||
callback(null, null);
|
||||
}
|
||||
}, null, givenCallback);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Helper;
|
||||
Loading…
Reference in a new issue