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
57
gaia/apps/clock/test/marionette/lib/timer_actions.js
Executable file
57
gaia/apps/clock/test/marionette/lib/timer_actions.js
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
var $ = require('./mquery');
|
||||
var pickerUtils = require('./picker');
|
||||
|
||||
function TimerActions(client) {
|
||||
this._client = client;
|
||||
}
|
||||
|
||||
module.exports = TimerActions;
|
||||
|
||||
TimerActions.prototype = {
|
||||
|
||||
get hours() { return pickerUtils.getSpinnerValue('.picker-hours'); },
|
||||
get minutes() { return pickerUtils.getSpinnerValue('.picker-minutes'); },
|
||||
set hours(value) { pickerUtils.setSpinnerValue('.picker-hours', value); },
|
||||
set minutes(value) { pickerUtils.setSpinnerValue('.picker-minutes', value); },
|
||||
|
||||
get countdown() {
|
||||
return utils.extractDuration($('#timer-time').text());
|
||||
},
|
||||
|
||||
get sound() {
|
||||
return $('#timer-sound').val();
|
||||
},
|
||||
|
||||
start: function() {
|
||||
$('#timer-create').tap();
|
||||
// Wait until the timer has moved from its default state of 0:00
|
||||
this._client.waitFor(function() {
|
||||
return this.countdown > 0;
|
||||
}.bind(this));
|
||||
return this;
|
||||
},
|
||||
|
||||
pause: function() {
|
||||
$('#timer-pause').tap();
|
||||
return this;
|
||||
},
|
||||
|
||||
resume: function() {
|
||||
$('#timer-start').tap();
|
||||
return this;
|
||||
},
|
||||
|
||||
cancel: function() {
|
||||
$('#timer-cancel').tap();
|
||||
$('#timer-create').waitToAppear();
|
||||
return this;
|
||||
},
|
||||
|
||||
advanceTime: function(milliseconds) {
|
||||
return this._client.helper.wait(milliseconds);
|
||||
}
|
||||
|
||||
};
|
||||
Loading…
Reference in a new issue