Bug 852411 - Migrating from promise.js to Promise.jsm; r=gps

--HG--
extra : rebase_source : d03cdae978479605df0a7ea728916ba78a272ffb
This commit is contained in:
Stefan Mirea 2013-06-13 18:36:21 -07:00
parent 5057007762
commit c338d6a58e
23 changed files with 59 additions and 79 deletions

View File

@ -23,7 +23,6 @@ function sendNotifyRequest(name) {
service.healthReporter.onInit().then(function onInit() {
is(policy.ensureNotifyResponse(new Date()), false, "User has not responded to policy.");
is(policy.notifyState, policy.STATE_NOTIFY_WAIT, "Policy is waiting for notification response.");
});
return policy;

View File

@ -45,7 +45,7 @@ function test() {
gURLBar.value = "firefox health report";
gURLBar.handleCommand();
executeSoon(function afterSearch() {
executeSoon(() => executeSoon(() => {
gBrowser.removeTab(tab);
m.getValues().then(function onData(data) {
@ -58,7 +58,7 @@ function test() {
is(newCount, oldCount + 1, "Exactly one search has been recorded.");
finish();
});
});
}));
});
});
}

View File

@ -66,7 +66,7 @@ function test() {
}
EventUtils.synthesizeKey("VK_RETURN", {});
executeSoon(afterSearch);
executeSoon(() => executeSoon(afterSearch));
});
});
}

View File

@ -22,7 +22,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
#endif
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/rest.js");

View File

@ -6,7 +6,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
this.EXPORTED_SYMBOLS = ["CommonUtils"];
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/osfile.jsm")

View File

@ -26,7 +26,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
#endif
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/utils.js");
@ -69,12 +69,12 @@ const OLDEST_ALLOWED_YEAR = 2012;
*
* @param policy
* (DataReportingPolicy) The policy instance this request came from.
* @param promise
* @param deferred
* (deferred) The promise that will be fulfilled when display occurs.
*/
function NotifyPolicyRequest(policy, promise) {
function NotifyPolicyRequest(policy, deferred) {
this.policy = policy;
this.promise = promise;
this.deferred = deferred;
}
NotifyPolicyRequest.prototype = {
/**
@ -84,7 +84,8 @@ NotifyPolicyRequest.prototype = {
* acceptance of the data policy.
*/
onUserNotifyComplete: function onUserNotified() {
this.promise.resolve();
this.deferred.resolve();
return this.deferred.promise;
},
/**
@ -94,7 +95,7 @@ NotifyPolicyRequest.prototype = {
* (Error) Explains what went wrong.
*/
onUserNotifyFailed: function onUserNotifyFailed(error) {
this.promise.reject(error);
this.deferred.reject(error);
},
/**
@ -158,6 +159,7 @@ DataSubmissionRequest.prototype = {
onNoDataAvailable: function onNoDataAvailable() {
this.state = this.NO_DATA_AVAILABLE;
this.promise.resolve(this);
return this.promise.promise;
},
/**
@ -173,6 +175,7 @@ DataSubmissionRequest.prototype = {
this.state = this.SUBMISSION_SUCCESS;
this.submissionDate = date;
this.promise.resolve(this);
return this.promise.promise;
},
/**
@ -188,6 +191,7 @@ DataSubmissionRequest.prototype = {
this.state = this.SUBMISSION_FAILURE_SOFT;
this.reason = reason;
this.promise.resolve(this);
return this.promise.promise;
},
/**
@ -204,6 +208,7 @@ DataSubmissionRequest.prototype = {
this.state = this.SUBMISSION_FAILURE_HARD;
this.reason = reason;
this.promise.resolve(this);
return this.promise.promise;
},
};

View File

@ -138,7 +138,7 @@ add_test(function test_notify_state_prefs() {
run_next_test();
});
add_test(function test_initial_submission_notification() {
add_task(function test_initial_submission_notification() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("initial_submission_notification");
do_check_eq(listener.notifyUserCount, 0);
@ -160,14 +160,12 @@ add_test(function test_initial_submission_notification() {
policy.SUBMISSION_NOTIFY_INTERVAL_MSEC));
policy.checkStateAndTrigger();
do_check_eq(listener.notifyUserCount, 1);
listener.lastNotifyRequest.onUserNotifyComplete();
yield listener.lastNotifyRequest.onUserNotifyComplete();
do_check_true(policy._dataSubmissionPolicyNotifiedDate instanceof Date);
do_check_true(policy.dataSubmissionPolicyNotifiedDate.getTime() > 0);
do_check_eq(policy.dataSubmissionPolicyNotifiedDate.getTime(),
policy._dataSubmissionPolicyNotifiedDate.getTime());
do_check_eq(policy.notifyState, policy.STATE_NOTIFY_WAIT);
run_next_test();
});
add_test(function test_bypass_acceptance() {
@ -183,7 +181,7 @@ add_test(function test_bypass_acceptance() {
run_next_test();
});
add_test(function test_notification_implicit_acceptance() {
add_task(function test_notification_implicit_acceptance() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("notification_implicit_acceptance");
let now = new Date(policy.nextDataSubmissionDate.getTime() -
@ -191,7 +189,7 @@ add_test(function test_notification_implicit_acceptance() {
defineNow(policy, now);
policy.checkStateAndTrigger();
do_check_eq(listener.notifyUserCount, 1);
listener.lastNotifyRequest.onUserNotifyComplete();
yield listener.lastNotifyRequest.onUserNotifyComplete();
do_check_eq(policy.dataSubmissionPolicyResponseType, "none-recorded");
do_check_true(5000 < policy.IMPLICIT_ACCEPTANCE_INTERVAL_MSEC);
@ -208,11 +206,9 @@ add_test(function test_notification_implicit_acceptance() {
do_check_eq(policy.notifyState, policy.STATE_NOTIFY_COMPLETE);
do_check_eq(policy.dataSubmissionPolicyResponseDate.getTime(), policy.now().getTime());
do_check_eq(policy.dataSubmissionPolicyResponseType, "accepted-implicit-time-elapsed");
run_next_test();
});
add_test(function test_notification_rejected() {
add_task(function test_notification_rejected() {
// User notification failed. We should not record it as being presented.
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("notification_failed");
@ -221,22 +217,20 @@ add_test(function test_notification_rejected() {
defineNow(policy, now);
policy.checkStateAndTrigger();
do_check_eq(listener.notifyUserCount, 1);
listener.lastNotifyRequest.onUserNotifyFailed(new Error("testing failed."));
yield listener.lastNotifyRequest.onUserNotifyFailed(new Error("testing failed."));
do_check_null(policy._dataSubmissionPolicyNotifiedDate);
do_check_eq(policy.dataSubmissionPolicyNotifiedDate.getTime(), 0);
do_check_eq(policy.notifyState, policy.STATE_NOTIFY_UNNOTIFIED);
run_next_test();
});
add_test(function test_notification_accepted() {
add_task(function test_notification_accepted() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("notification_accepted");
let now = new Date(policy.nextDataSubmissionDate.getTime() -
policy.SUBMISSION_NOTIFY_INTERVAL_MSEC + 1);
defineNow(policy, now);
policy.checkStateAndTrigger();
listener.lastNotifyRequest.onUserNotifyComplete();
yield listener.lastNotifyRequest.onUserNotifyComplete();
do_check_eq(policy.notifyState, policy.STATE_NOTIFY_WAIT);
do_check_false(policy.dataSubmissionPolicyAccepted);
listener.lastNotifyRequest.onUserNotifyComplete();
@ -245,18 +239,16 @@ add_test(function test_notification_accepted() {
do_check_eq(policy.dataSubmissionPolicyResponseType, "accepted-foo-bar");
do_check_true(policy.dataSubmissionPolicyAccepted);
do_check_eq(policy.dataSubmissionPolicyResponseDate.getTime(), now.getTime());
run_next_test();
});
add_test(function test_notification_rejected() {
add_task(function test_notification_rejected() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("notification_rejected");
let now = new Date(policy.nextDataSubmissionDate.getTime() -
policy.SUBMISSION_NOTIFY_INTERVAL_MSEC + 1);
defineNow(policy, now);
policy.checkStateAndTrigger();
listener.lastNotifyRequest.onUserNotifyComplete();
yield listener.lastNotifyRequest.onUserNotifyComplete();
do_check_eq(policy.notifyState, policy.STATE_NOTIFY_WAIT);
do_check_false(policy.dataSubmissionPolicyAccepted);
listener.lastNotifyRequest.onUserReject();
@ -268,8 +260,6 @@ add_test(function test_notification_rejected() {
defineNow(policy, new Date(policy.nextDataSubmissionDate.getTime() + 10000));
policy.checkStateAndTrigger();
do_check_eq(listener.requestDataUploadCount, 0);
run_next_test();
});
add_test(function test_submission_kill_switch() {
@ -331,7 +321,7 @@ add_test(function test_data_submission_no_data() {
run_next_test();
});
add_test(function test_data_submission_submit_failure_hard() {
add_task(function test_data_submission_submit_failure_hard() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("data_submission_submit_failure_hard");
policy.dataSubmissionPolicyResponseDate = new Date(Date.now() - 24 * 60 * 60 * 1000);
@ -342,7 +332,7 @@ add_test(function test_data_submission_submit_failure_hard() {
policy.checkStateAndTrigger();
do_check_eq(listener.requestDataUploadCount, 1);
listener.lastDataRequest.onSubmissionFailureHard();
yield listener.lastDataRequest.onSubmissionFailureHard();
do_check_eq(listener.lastDataRequest.state,
listener.lastDataRequest.SUBMISSION_FAILURE_HARD);
@ -352,11 +342,9 @@ add_test(function test_data_submission_submit_failure_hard() {
defineNow(policy, new Date(now.getTime() + 10));
policy.checkStateAndTrigger();
do_check_eq(listener.requestDataUploadCount, 1);
run_next_test();
});
add_test(function test_data_submission_submit_try_again() {
add_task(function test_data_submission_submit_try_again() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("data_submission_failure_soft");
policy.recordUserAcceptance();
@ -364,14 +352,12 @@ add_test(function test_data_submission_submit_try_again() {
let now = new Date(policy.nextDataSubmissionDate.getTime());
defineNow(policy, now);
policy.checkStateAndTrigger();
listener.lastDataRequest.onSubmissionFailureSoft();
yield listener.lastDataRequest.onSubmissionFailureSoft();
do_check_eq(policy.nextDataSubmissionDate.getTime(),
nextDataSubmissionDate.getTime() + 15 * 60 * 1000);
run_next_test();
});
add_test(function test_submission_daily_scheduling() {
add_task(function test_submission_daily_scheduling() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("submission_daily_scheduling");
policy.dataSubmissionPolicyResponseDate = new Date(Date.now() - 24 * 60 * 60 * 1000);
@ -387,7 +373,7 @@ add_test(function test_submission_daily_scheduling() {
let finishedDate = new Date(now.getTime() + 250);
defineNow(policy, new Date(finishedDate.getTime() + 50));
listener.lastDataRequest.onSubmissionSuccess(finishedDate);
yield listener.lastDataRequest.onSubmissionSuccess(finishedDate);
do_check_eq(policy.lastDataSubmissionSuccessfulDate.getTime(), finishedDate.getTime());
// Next scheduled submission should be exactly 1 day after the reported
@ -404,11 +390,9 @@ add_test(function test_submission_daily_scheduling() {
defineNow(policy, nextScheduled);
policy.checkStateAndTrigger();
do_check_eq(listener.requestDataUploadCount, 2);
listener.lastDataRequest.onSubmissionSuccess(new Date(nextScheduled.getTime() + 200));
yield listener.lastDataRequest.onSubmissionSuccess(new Date(nextScheduled.getTime() + 200));
do_check_eq(policy.nextDataSubmissionDate.getTime(),
new Date(nextScheduled.getTime() + 24 * 60 * 60 * 1000 + 200).getTime());
run_next_test();
});
add_test(function test_submission_far_future_scheduling() {
@ -435,7 +419,7 @@ add_test(function test_submission_far_future_scheduling() {
run_next_test();
});
add_test(function test_submission_backoff() {
add_task(function test_submission_backoff() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("submission_backoff");
do_check_eq(policy.FAILURE_BACKOFF_INTERVALS.length, 2);
@ -453,7 +437,7 @@ add_test(function test_submission_backoff() {
defineNow(policy, now);
// On first soft failure we should back off by scheduled interval.
listener.lastDataRequest.onSubmissionFailureSoft();
yield listener.lastDataRequest.onSubmissionFailureSoft();
do_check_eq(policy.currentDaySubmissionFailureCount, 1);
do_check_eq(policy.nextDataSubmissionDate.getTime(),
new Date(now.getTime() + policy.FAILURE_BACKOFF_INTERVALS[0]).getTime());
@ -475,7 +459,7 @@ add_test(function test_submission_backoff() {
defineNow(policy, now);
// On second failure we should back off by more.
listener.lastDataRequest.onSubmissionFailureSoft();
yield listener.lastDataRequest.onSubmissionFailureSoft();
do_check_eq(policy.currentDaySubmissionFailureCount, 2);
do_check_eq(policy.nextDataSubmissionDate.getTime(),
new Date(now.getTime() + policy.FAILURE_BACKOFF_INTERVALS[1]).getTime());
@ -489,12 +473,10 @@ add_test(function test_submission_backoff() {
defineNow(policy, now);
// On 3rd failure we should back off by a whole day.
listener.lastDataRequest.onSubmissionFailureSoft();
yield listener.lastDataRequest.onSubmissionFailureSoft();
do_check_eq(policy.currentDaySubmissionFailureCount, 0);
do_check_eq(policy.nextDataSubmissionDate.getTime(),
new Date(now.getTime() + 24 * 60 * 60 * 1000).getTime());
run_next_test();
});
// Ensure that only one submission request can be active at a time.
@ -521,7 +503,7 @@ add_test(function test_submission_expiring() {
run_next_test();
});
add_test(function test_delete_remote_data() {
add_task(function test_delete_remote_data() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("delete_remote_data");
do_check_false(policy.pendingDeleteRemoteData);
@ -540,10 +522,8 @@ add_test(function test_delete_remote_data() {
do_check_true(listener.lastRemoteDeleteRequest.isDelete);
defineNow(policy, policy._futureDate(1000));
listener.lastRemoteDeleteRequest.onSubmissionSuccess(policy.now());
yield listener.lastRemoteDeleteRequest.onSubmissionSuccess(policy.now());
do_check_false(policy.pendingDeleteRemoteData);
run_next_test();
});
// Ensure that deletion requests take priority over regular data submission.
@ -601,7 +581,7 @@ add_test(function test_delete_remote_data_backoff() {
// If we request delete while an upload is in progress, delete should be
// scheduled immediately after upload.
add_test(function test_delete_remote_data_in_progress_upload() {
add_task(function test_delete_remote_data_in_progress_upload() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("delete_remote_data_in_progress_upload");
let now = new Date();
@ -621,14 +601,12 @@ add_test(function test_delete_remote_data_in_progress_upload() {
// Now wait a little bit and finish the request.
defineNow(policy, policy._futureDate(10 * 1000));
listener.lastDataRequest.onSubmissionSuccess(policy._futureDate(1000));
yield listener.lastDataRequest.onSubmissionSuccess(policy._futureDate(1000));
defineNow(policy, policy._futureDate(5000));
policy.checkStateAndTrigger();
do_check_eq(listener.requestDataUploadCount, 1);
do_check_eq(listener.requestRemoteDeleteCount, 1);
run_next_test();
});
add_test(function test_polling() {
@ -747,7 +725,7 @@ add_test(function test_polling_implicit_acceptance() {
policy.startPolling();
});
add_test(function test_record_health_report_upload_enabled() {
add_task(function test_record_health_report_upload_enabled() {
let [policy, policyPrefs, hrPrefs, listener] = getPolicy("record_health_report_upload_enabled");
// Preconditions.
@ -763,15 +741,13 @@ add_test(function test_record_health_report_upload_enabled() {
do_check_eq(listener.requestRemoteDeleteCount, 1);
// Fulfilling it should make it go away.
listener.lastRemoteDeleteRequest.onNoDataAvailable();
yield listener.lastRemoteDeleteRequest.onNoDataAvailable();
do_check_false(policy.pendingDeleteRemoteData);
// User intent to enable should get us back to default state.
policy.recordHealthReportUploadEnabled(true, "testing 1 2 3");
do_check_false(policy.pendingDeleteRemoteData);
do_check_true(policy.healthReportUploadEnabled);
run_next_test();
});
add_test(function test_pref_change_initiates_deletion() {

View File

@ -5,7 +5,7 @@
const {utils: Cu} = Components;
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/services/datareporting/sessions.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://services-common/utils.js");

View File

@ -20,7 +20,7 @@ Cu.import("resource://services-common/bagheeraclient.js");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/utils.js");
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -15,7 +15,7 @@ this.EXPORTED_SYMBOLS = [
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

View File

@ -22,7 +22,7 @@ Cu.import("resource://gre/modules/Metrics.jsm");
const DEFAULT_PROFILE_MEASUREMENT_NAME = "age";
const REQUIRED_UINT32_TYPE = {type: "TYPE_UINT32"};
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/osfile.jsm")
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://services-common/log4moz.js");

View File

@ -34,7 +34,7 @@ Cu.import("resource://gre/modules/Metrics.jsm");
#endif
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -7,7 +7,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://services-common/observers.js");
Cu.import("resource://services-common/utils.js");
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");

View File

@ -12,7 +12,7 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
let profile_creation_lower = Date.now() - MILLISECONDS_PER_DAY;
do_get_profile();
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://gre/modules/services/healthreport/profile.jsm");
Cu.import("resource://gre/modules/Task.jsm");

View File

@ -6,7 +6,7 @@
const {utils: Cu} = Components;
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/services-common/utils.js");

View File

@ -17,7 +17,7 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
#endif
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://services-common/log4moz.js");

View File

@ -15,7 +15,7 @@ this.EXPORTED_SYMBOLS = [
const {utils: Cu} = Components;
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://gre/modules/Task.jsm");

View File

@ -12,7 +12,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/services/metrics/dataprovider.jsm");
#endif
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://services-common/log4moz.js");
Cu.import("resource://services-common/utils.js");

View File

@ -19,7 +19,7 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
#endif
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Sqlite.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://services-common/log4moz.js");

View File

@ -5,7 +5,7 @@
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://testing-common/services/metrics/mocks.jsm");

View File

@ -5,7 +5,7 @@
const {utils: Cu} = Components;
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://services-common/utils.js");

View File

@ -10,7 +10,7 @@ Cu.import("resource://services-sync/engines/bookmarks.js");
Cu.import("resource://services-sync/service.js");
Cu.import("resource://services-sync/util.js");
Cu.import("resource://testing-common/services/sync/utils.js");
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
Service.engineManager.register(BookmarksEngine);
var syncTesting = new SyncTestingInfrastructure();

View File

@ -11,7 +11,7 @@ Cu.import("resource://services-sync/service.js");
Cu.import("resource://services-sync/status.js");
Cu.import("resource://services-sync/util.js");
Cu.import("resource://testing-common/services/sync/utils.js");
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
Cu.import("resource://gre/modules/Promise.jsm");
add_task(function test_locally_changed_keys() {
let passphrase = "abcdeabcdeabcdeabcdeabcdea";