merge b2g-inbound to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2013-12-12 13:26:40 +01:00
Родитель d1c5c697a3 b9e2273819
Коммит a021b8c618
8 изменённых файлов: 3392 добавлений и 3136 удалений

Просмотреть файл

@ -1,4 +1,4 @@
{ {
"revision": "8a192fcf2927a866574996b4895426213e01a325", "revision": "5bfef5faac50d14e055f642a44ed2df8483fb2fe",
"repo_path": "/integration/gaia-central" "repo_path": "/integration/gaia-central"
} }

Просмотреть файл

@ -57,7 +57,7 @@ MOZ_PLACES=
MOZ_B2G=1 MOZ_B2G=1
if test "$OS_TARGET" = "Android"; then if test "$OS_TARGET" = "Android"; then
MOZ_NUWA_PROCESS=0 MOZ_NUWA_PROCESS=
fi fi
MOZ_FOLD_LIBS=1 MOZ_FOLD_LIBS=1

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -22,6 +22,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']:
EXTRA_JS_MODULES = [ EXTRA_JS_MODULES = [
'gonk/mms_consts.js', 'gonk/mms_consts.js',
'gonk/MmsPduHelper.jsm', 'gonk/MmsPduHelper.jsm',
'gonk/MobileMessageDB.jsm',
'gonk/wap_consts.js', 'gonk/wap_consts.js',
'gonk/WspPduHelper.jsm', 'gonk/WspPduHelper.jsm',
] ]

Просмотреть файл

@ -8,7 +8,7 @@ let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
/* Push required permissions and test if |navigator.mozMobileMessage| exists. /* Push required permissions and test if |navigator.mozMobileMessage| exists.
* Resolve if it does, reject otherwise. * Resolve if it does, reject otherwise.
* *
* Forfill params: * Fulfill params:
* manager -- an reference to navigator.mozMobileMessage. * manager -- an reference to navigator.mozMobileMessage.
* *
* Reject params: (none) * Reject params: (none)
@ -47,7 +47,7 @@ function ensureMobileMessage() {
/* Send a SMS message to a single receiver. Resolve if it succeeds, reject /* Send a SMS message to a single receiver. Resolve if it succeeds, reject
* otherwise. * otherwise.
* *
* Forfill params: * Fulfill params:
* message -- the sent SmsMessage. * message -- the sent SmsMessage.
* *
* Reject params: * Reject params:
@ -75,7 +75,7 @@ function sendSmsWithSuccess(aReceiver, aText) {
/* Send a MMS message with specified parameters. Resolve if it fails, reject /* Send a MMS message with specified parameters. Resolve if it fails, reject
* otherwise. * otherwise.
* *
* Forfill params: * Fulfill params:
* message -- the failed MmsMessage * message -- the failed MmsMessage
* *
* Reject params: (none) * Reject params: (none)
@ -102,7 +102,7 @@ function sendMmsWithFailure(aMmsParameters) {
/* Retrieve messages from database. /* Retrieve messages from database.
* *
* Forfill params: * Fulfill params:
* messages -- an array of {Sms,Mms}Message instances. * messages -- an array of {Sms,Mms}Message instances.
* *
* Reject params: * Reject params:
@ -138,7 +138,7 @@ function getMessages(aFilter, aReverse) {
/* Retrieve all messages from database. /* Retrieve all messages from database.
* *
* Forfill params: * Fulfill params:
* messages -- an array of {Sms,Mms}Message instances. * messages -- an array of {Sms,Mms}Message instances.
* *
* Reject params: * Reject params:
@ -152,7 +152,7 @@ function getAllMessages() {
/* Retrieve all threads from database. /* Retrieve all threads from database.
* *
* Forfill params: * Fulfill params:
* threads -- an array of MozMobileMessageThread instances. * threads -- an array of MozMobileMessageThread instances.
* *
* Reject params: * Reject params:
@ -181,7 +181,7 @@ function getAllThreads() {
/* Retrieve a single specified thread from database. /* Retrieve a single specified thread from database.
* *
* Forfill params: * Fulfill params:
* thread -- a MozMobileMessageThread instance. * thread -- a MozMobileMessageThread instance.
* *
* Reject params: * Reject params:
@ -206,7 +206,7 @@ function getThreadById(aThreadId) {
/* Delete messages specified from database. /* Delete messages specified from database.
* *
* Forfill params: * Fulfill params:
* result -- an array of boolean values indicating whether delesion was * result -- an array of boolean values indicating whether delesion was
* actually performed on the message record with corresponding id. * actually performed on the message record with corresponding id.
* *
@ -236,7 +236,7 @@ function deleteMessagesById(aMessageIds) {
/* Delete messages specified from database. /* Delete messages specified from database.
* *
* Forfill params: * Fulfill params:
* result -- an array of boolean values indicating whether delesion was * result -- an array of boolean values indicating whether delesion was
* actually performed on the message record with corresponding id. * actually performed on the message record with corresponding id.
* *
@ -254,7 +254,7 @@ function deleteMessages(aMessages) {
/* Delete all messages from database. /* Delete all messages from database.
* *
* Forfill params: * Fulfill params:
* ids -- an array of numeric values identifying those deleted * ids -- an array of numeric values identifying those deleted
* {Sms,Mms}Messages. * {Sms,Mms}Messages.
* *
@ -275,7 +275,7 @@ let pendingEmulatorCmdCount = 0;
* end, so here comes with the pending counter. Resolve when the emulator * end, so here comes with the pending counter. Resolve when the emulator
* gives positive response, and reject otherwise. * gives positive response, and reject otherwise.
* *
* Forfill params: * Fulfill params:
* result -- an array of emulator response lines. * result -- an array of emulator response lines.
* *
* Reject params: * Reject params:
@ -303,7 +303,7 @@ function runEmulatorCmdSafe(aCommand) {
/* Send simple text SMS to emulator. /* Send simple text SMS to emulator.
* *
* Forfill params: * Fulfill params:
* result -- an array of emulator response lines. * result -- an array of emulator response lines.
* *
* Reject params: * Reject params:
@ -318,7 +318,7 @@ function sendTextSmsToEmulator(aFrom, aText) {
/* Send raw SMS TPDU to emulator. /* Send raw SMS TPDU to emulator.
* *
* Forfill params: * Fulfill params:
* result -- an array of emulator response lines. * result -- an array of emulator response lines.
* *
* Reject params: * Reject params:
@ -331,6 +331,62 @@ function sendRawSmsToEmulator(aPdu) {
return runEmulatorCmdSafe(command); return runEmulatorCmdSafe(command);
} }
/* Name space for MobileMessageDB.jsm. Only initialized after first call to
* newMobileMessageDB.
*/
let MMDB;
// Create a new MobileMessageDB instance.
function newMobileMessageDB() {
if (!MMDB) {
MMDB = Cu.import("resource://gre/modules/MobileMessageDB.jsm", {});
is(typeof MMDB.MobileMessageDB, "function", "MMDB.MobileMessageDB");
}
let mmdb = new MMDB.MobileMessageDB();
ok(mmdb, "MobileMessageDB instance");
return mmdb;
}
/* Initialize a MobileMessageDB. Resolve if initialized with success, reject
* otherwise.
*
* Fulfill params: a MobileMessageDB instance.
* Reject params: a MobileMessageDB instance.
*
* @param aMmdb
* A MobileMessageDB instance.
* @param aDbName
* A string name for that database.
* @param aDbVersion
* The version that MobileMessageDB should upgrade to. 0 for the lastest
* version.
*
* @return A deferred promise.
*/
function initMobileMessageDB(aMmdb, aDbName, aDbVersion) {
let deferred = Promise.defer();
aMmdb.init(aDbName, aDbVersion, function(aError) {
if (aError) {
deferred.reject(aMmdb);
} else {
deferred.resolve(aMmdb);
}
});
return deferred.promise;
}
/* Close a MobileMessageDB.
*
* @return The passed MobileMessageDB instance.
*/
function closeMobileMessageDB(aMmdb) {
aMmdb.close();
return aMmdb;
}
/* Create a new array of id attribute of input messages. /* Create a new array of id attribute of input messages.
* *
* @param aMessages an array of {Sms,Mms}Message instances. * @param aMessages an array of {Sms,Mms}Message instances.
@ -345,6 +401,23 @@ function messagesToIds(aMessages) {
return ids; return ids;
} }
// A reference to a nsIUUIDGenerator service.
let uuidGenerator;
/* Generate a new UUID.
*
* @return A UUID string.
*/
function newUUID() {
if (!uuidGenerator) {
uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
.getService(Ci.nsIUUIDGenerator);
ok(uuidGenerator, "uuidGenerator");
}
return uuidGenerator.generateUUID().toString();
}
/* Flush permission settings and call |finish()|. /* Flush permission settings and call |finish()|.
*/ */
function cleanUp() { function cleanUp() {
@ -360,13 +433,20 @@ function cleanUp() {
}); });
} }
function startTestCommon(aTestCaseMain) { function startTestBase(aTestCaseMain) {
ensureMobileMessage() Promise.resolve()
.then(deleteAllMessages) .then(aTestCaseMain)
.then(aTestCaseMain) .then(cleanUp, function() {
.then(deleteAllMessages) ok(false, 'promise rejects during test.');
.then(cleanUp, function() { cleanUp();
ok(false, 'promise rejects during test.'); });
cleanUp(); }
});
function startTestCommon(aTestCaseMain) {
startTestBase(function() {
return ensureMobileMessage()
.then(deleteAllMessages)
.then(aTestCaseMain)
.then(deleteAllMessages);
});
} }

Просмотреть файл

@ -39,5 +39,6 @@ qemu = true
[test_smsc_address.js] [test_smsc_address.js]
[test_dsds_default_service_id.js] [test_dsds_default_service_id.js]
[test_thread_subject.js] [test_thread_subject.js]
[test_mmdb_new.js]
[test_mmdb_setmessagedeliverybyid_sms.js] [test_mmdb_setmessagedeliverybyid_sms.js]
[test_replace_short_message_type.js] [test_replace_short_message_type.js]

Просмотреть файл

@ -0,0 +1,34 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
startTestBase(function testCaseMain() {
log("Test init MobileMessageDB");
let mmdb = newMobileMessageDB();
let dbName = "test_mmdb_new";
let dbVersion = 0;
let check = function() {
is(mmdb.dbName, dbName, "dbName");
if (!dbVersion) {
ok(mmdb.dbVersion, "dbVersion");
dbVersion = mmdb.dbVersion;
} else {
is(mmdb.dbVersion, dbVersion, "dbVersion");
}
};
return initMobileMessageDB(mmdb, dbName, dbVersion)
.then(check)
.then(closeMobileMessageDB.bind(null, mmdb))
.then(check)
.then(function() {
log("Test re-init and close.");
return initMobileMessageDB(mmdb, dbName, dbVersion);
})
.then(check)
.then(closeMobileMessageDB.bind(null, mmdb))
.then(check);
});