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
44
gaia/apps/email/test/marionette/lib/email_sync.js
Executable file
44
gaia/apps/email/test/marionette/lib/email_sync.js
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
'use strict';
|
||||
/*jshint node: true, browser: true */
|
||||
var SHARED_PATH = __dirname + '/../../../../../shared/test/integration';
|
||||
|
||||
function EmailSync(client) {
|
||||
this.client = client;
|
||||
}
|
||||
module.exports = EmailSync;
|
||||
|
||||
EmailSync.prototype = {
|
||||
/**
|
||||
* Call this in the setup() for the test.
|
||||
*/
|
||||
|
||||
setup: function() {
|
||||
this.client.contentScript.inject(
|
||||
SHARED_PATH + '/mock_navigator_moz_set_message_handler.js'
|
||||
);
|
||||
this.client.contentScript.inject(
|
||||
SHARED_PATH + '/mock_navigator_mozalarms.js'
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Does the work to trigger a sync using helpers in
|
||||
* mock_navigator_moz_set_message_handler.js.
|
||||
*/
|
||||
triggerSync: function() {
|
||||
// trigger sync in Email App
|
||||
this.client.executeScript(function() {
|
||||
var interval = 1000;
|
||||
var date = new Date(Date.now() + interval).getTime();
|
||||
var alarm = {
|
||||
data: {
|
||||
type: 'sync',
|
||||
accountIds: ['0', '1'],
|
||||
interval: interval,
|
||||
timestamp: date
|
||||
}
|
||||
};
|
||||
return window.wrappedJSObject.fireMessageHandler(alarm, 'alarm');
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue