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
73
gaia/apps/system/test/raptor/lockscreen-lock2unlock-test.js
Executable file
73
gaia/apps/system/test/raptor/lockscreen-lock2unlock-test.js
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
'use strict';
|
||||
|
||||
/* global setup, afterEach, marionetteScriptFinished */
|
||||
/* Test from lock to unlock, how long does it take. */
|
||||
setup(function(options) {
|
||||
options.phase = 'reboot';
|
||||
});
|
||||
|
||||
afterEach(function(phase) {
|
||||
return phase.device.marionette
|
||||
.startSession()
|
||||
.then(function(client) {
|
||||
var Deferred = function() {
|
||||
this.promise = new Promise((function(res, rej) {
|
||||
this.resolve = res;
|
||||
this.reject = rej;
|
||||
}).bind(this));
|
||||
return this;
|
||||
};
|
||||
var deferred = new Deferred();
|
||||
deferred.promise = deferred.promise.then(function() {
|
||||
client.deleteSession();
|
||||
}).catch(function(err) {
|
||||
console.error(err);
|
||||
throw err;
|
||||
});
|
||||
client.switchToFrame();
|
||||
client.executeAsyncScript(function() {
|
||||
var settings = window.wrappedJSObject.navigator.mozSettings;
|
||||
var lock = settings.createLock();
|
||||
lock.set({
|
||||
'lockscreen.enabled': true
|
||||
}).then(function() {
|
||||
marionetteScriptFinished(null, 'success');
|
||||
}).catch(function(err) {
|
||||
marionetteScriptFinished(err, 'falied');
|
||||
});
|
||||
});
|
||||
client.executeScript(function() {
|
||||
window.wrappedJSObject.Service.request('lock');
|
||||
});
|
||||
client.waitFor(function() {
|
||||
return client.executeScript(function() {
|
||||
return window.wrappedJSObject.Service.query('locked');
|
||||
});
|
||||
});
|
||||
client.executeScript(function() {
|
||||
window.wrappedJSObject.Service.request('unlock');
|
||||
});
|
||||
client.waitFor(function() {
|
||||
return client.executeScript(function() {
|
||||
return !window.wrappedJSObject.Service.query('locked');
|
||||
});
|
||||
});
|
||||
client.executeAsyncScript(function() {
|
||||
var settings = window.wrappedJSObject.navigator.mozSettings;
|
||||
var lock = settings.createLock();
|
||||
lock.set({
|
||||
'lockscreen.enabled': false
|
||||
}).then(function() {
|
||||
marionetteScriptFinished(null, 'success');
|
||||
}).catch(function(err) {
|
||||
marionetteScriptFinished(err, 'falied');
|
||||
});
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
deferred.reject(err);
|
||||
}
|
||||
deferred.resolve();
|
||||
});
|
||||
return deferred.promise;
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue