зеркало из https://github.com/mozilla/gecko-dev.git
Bug 710961 - Carry over syncGUID generated when install is staged; r=Mossop
This commit is contained in:
Родитель
8cdb5ddd62
Коммит
31e220b695
|
@ -7283,9 +7283,10 @@ AddonInternal.prototype = {
|
|||
* A JS object containing the cached metadata
|
||||
*/
|
||||
importMetadata: function(aObj) {
|
||||
["targetApplications", "userDisabled", "softDisabled", "existingAddonID",
|
||||
"sourceURI", "releaseNotesURI", "installDate", "updateDate",
|
||||
"applyBackgroundUpdates", "compatibilityOverrides"].forEach(function(aProp) {
|
||||
["syncGUID", "targetApplications", "userDisabled", "softDisabled",
|
||||
"existingAddonID", "sourceURI", "releaseNotesURI", "installDate",
|
||||
"updateDate", "applyBackgroundUpdates", "compatibilityOverrides"]
|
||||
.forEach(function(aProp) {
|
||||
if (!(aProp in aObj))
|
||||
return;
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ function run_test_1() {
|
|||
do_check_eq(install.version, "1.0");
|
||||
do_check_eq(install.name, "Test Bootstrap 1");
|
||||
do_check_eq(install.state, AddonManager.STATE_DOWNLOADED);
|
||||
do_check_neq(install.addon.syncGUID, null);
|
||||
do_check_true(install.addon.hasResource("install.rdf"));
|
||||
do_check_true(install.addon.hasResource("bootstrap.js"));
|
||||
do_check_false(install.addon.hasResource("foo.bar"));
|
||||
|
@ -167,13 +168,13 @@ function run_test_1() {
|
|||
"onInstallEnded",
|
||||
], function() {
|
||||
do_check_true(addon.hasResource("install.rdf"));
|
||||
check_test_1();
|
||||
check_test_1(addon.syncGUID);
|
||||
});
|
||||
install.install();
|
||||
});
|
||||
}
|
||||
|
||||
function check_test_1() {
|
||||
function check_test_1(installSyncGUID) {
|
||||
let file = gProfD.clone();
|
||||
file.append("extensions.sqlite");
|
||||
do_check_true(file.exists());
|
||||
|
@ -189,6 +190,8 @@ function check_test_1() {
|
|||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_neq(b1, null);
|
||||
do_check_eq(b1.version, "1.0");
|
||||
do_check_neq(b1.syncGUID, null);
|
||||
do_check_eq(b1.syncGUID, installSyncGUID);
|
||||
do_check_false(b1.appDisabled);
|
||||
do_check_false(b1.userDisabled);
|
||||
do_check_true(b1.isActive);
|
||||
|
|
|
@ -105,7 +105,9 @@ function run_test_1() {
|
|||
}, [
|
||||
"onInstallStarted",
|
||||
"onInstallEnded",
|
||||
], check_test_1);
|
||||
], function() {
|
||||
check_test_1(install.addon.syncGUID);
|
||||
});
|
||||
install.install();
|
||||
});
|
||||
});
|
||||
|
@ -113,7 +115,7 @@ function run_test_1() {
|
|||
});
|
||||
}
|
||||
|
||||
function check_test_1() {
|
||||
function check_test_1(installSyncGUID) {
|
||||
ensure_test_completed();
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(olda1) {
|
||||
do_check_eq(olda1, null);
|
||||
|
@ -160,6 +162,7 @@ function check_test_1() {
|
|||
do_check_neq(a1, null);
|
||||
do_check_neq(a1.syncGUID, null);
|
||||
do_check_true(a1.syncGUID.length >= 9);
|
||||
do_check_eq(a1.syncGUID, installSyncGUID);
|
||||
do_check_eq(a1.type, "extension");
|
||||
do_check_eq(a1.version, "1.0");
|
||||
do_check_eq(a1.name, "Test 1");
|
||||
|
|
Загрузка…
Ссылка в новой задаче