mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 792546 - Part 4: Move utility functions to testing-only JS module; r=rnewman
This commit is contained in:
parent
bd79af95ab
commit
4fd177cc88
@ -65,6 +65,7 @@ sync_stage_modules := \
|
|||||||
sync_testing_modules := \
|
sync_testing_modules := \
|
||||||
fakeservices.js \
|
fakeservices.js \
|
||||||
rotaryengine.js \
|
rotaryengine.js \
|
||||||
|
utils.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
DIRS += locales
|
DIRS += locales
|
||||||
|
87
services/sync/modules-testing/utils.js
Normal file
87
services/sync/modules-testing/utils.js
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const EXPORTED_SYMBOLS = [
|
||||||
|
"TEST_CLUSTER_URL",
|
||||||
|
"TEST_SERVER_URL",
|
||||||
|
"btoa", // It comes from a module import.
|
||||||
|
"encryptPayload",
|
||||||
|
"setBasicCredentials",
|
||||||
|
"SyncTestingInfrastructure",
|
||||||
|
"waitForZeroTimer",
|
||||||
|
];
|
||||||
|
|
||||||
|
const {utils: Cu} = Components;
|
||||||
|
|
||||||
|
Cu.import("resource://services-common/utils.js");
|
||||||
|
Cu.import("resource://services-crypto/utils.js");
|
||||||
|
Cu.import("resource://testing-common/services-common/logging.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
||||||
|
|
||||||
|
const TEST_SERVER_URL = "http://localhost:8080/";
|
||||||
|
const TEST_CLUSTER_URL = TEST_SERVER_URL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* First wait >100ms (nsITimers can take up to that much time to fire, so
|
||||||
|
* we can account for the timer in delayedAutoconnect) and then two event
|
||||||
|
* loop ticks (to account for the Utils.nextTick() in autoConnect).
|
||||||
|
*/
|
||||||
|
function waitForZeroTimer(callback) {
|
||||||
|
let ticks = 2;
|
||||||
|
function wait() {
|
||||||
|
if (ticks) {
|
||||||
|
ticks -= 1;
|
||||||
|
CommonUtils.nextTick(wait);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
CommonUtils.namedTimer(wait, 150, {}, "timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
function setBasicCredentials(username, password, syncKey) {
|
||||||
|
let ns = {};
|
||||||
|
Cu.import("resource://services-sync/service.js", ns);
|
||||||
|
|
||||||
|
let auth = ns.Service.identity;
|
||||||
|
auth.username = username;
|
||||||
|
auth.basicPassword = password;
|
||||||
|
auth.syncKey = syncKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SyncTestingInfrastructure(username, password, syncKey) {
|
||||||
|
let ns = {};
|
||||||
|
Cu.import("resource://services-sync/service.js", ns);
|
||||||
|
|
||||||
|
let auth = ns.Service.identity;
|
||||||
|
auth.account = username || "foo";
|
||||||
|
auth.basicPassword = password || "password";
|
||||||
|
auth.syncKey = syncKey || "foo";
|
||||||
|
|
||||||
|
ns.Service.serverURL = TEST_SERVER_URL;
|
||||||
|
ns.Service.clusterURL = TEST_CLUSTER_URL;
|
||||||
|
|
||||||
|
this.logStats = initTestLogging();
|
||||||
|
this.fakeFilesystem = new FakeFilesystemService({});
|
||||||
|
this.fakeGUIDService = new FakeGUIDService();
|
||||||
|
this.fakeCryptoService = new FakeCryptoService();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn WBO cleartext into fake "encrypted" payload as it goes over the wire.
|
||||||
|
*/
|
||||||
|
function encryptPayload(cleartext) {
|
||||||
|
if (typeof cleartext == "object") {
|
||||||
|
cleartext = JSON.stringify(cleartext);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
ciphertext: cleartext, // ciphertext == cleartext with fake crypto
|
||||||
|
IV: "irrelevant",
|
||||||
|
hmac: fakeSHA256HMAC(cleartext, CryptoUtils.makeHMACKey("")),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,10 +6,6 @@ Cu.import("resource://services-common/async.js");
|
|||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
Cu.import("resource://services-sync/record.js");
|
Cu.import("resource://services-sync/record.js");
|
||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
|
||||||
|
|
||||||
let btoa;
|
|
||||||
let atob;
|
|
||||||
|
|
||||||
let provider = {
|
let provider = {
|
||||||
getFile: function(prop, persistent) {
|
getFile: function(prop, persistent) {
|
||||||
@ -25,26 +21,6 @@ let provider = {
|
|||||||
};
|
};
|
||||||
Services.dirsvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
|
Services.dirsvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
|
||||||
|
|
||||||
let timer;
|
|
||||||
function waitForZeroTimer(callback) {
|
|
||||||
// First wait >100ms (nsITimers can take up to that much time to fire, so
|
|
||||||
// we can account for the timer in delayedAutoconnect) and then two event
|
|
||||||
// loop ticks (to account for the Utils.nextTick() in autoConnect).
|
|
||||||
let ticks = 2;
|
|
||||||
function wait() {
|
|
||||||
if (ticks) {
|
|
||||||
ticks -= 1;
|
|
||||||
Utils.nextTick(wait);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
timer = Utils.namedTimer(wait, 150, {}, "timer");
|
|
||||||
}
|
|
||||||
|
|
||||||
btoa = Cu.import("resource://services-common/log4moz.js").btoa;
|
|
||||||
atob = Cu.import("resource://services-common/log4moz.js").atob;
|
|
||||||
|
|
||||||
// This is needed for loadAddonTestFunctions().
|
// This is needed for loadAddonTestFunctions().
|
||||||
let gGlobalScope = this;
|
let gGlobalScope = this;
|
||||||
|
|
||||||
@ -146,33 +122,7 @@ function uninstallAddon(addon) {
|
|||||||
Async.waitForSyncCallback(cb);
|
Async.waitForSyncCallback(cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBasicCredentials(username, password, syncKey) {
|
|
||||||
let ns = {};
|
|
||||||
Cu.import("resource://services-sync/service.js", ns);
|
|
||||||
|
|
||||||
let auth = ns.Service.identity;
|
|
||||||
auth.username = username;
|
|
||||||
auth.basicPassword = password;
|
|
||||||
auth.syncKey = syncKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
function SyncTestingInfrastructure(username, password, syncKey) {
|
|
||||||
let ns = {};
|
|
||||||
Cu.import("resource://services-sync/service.js", ns);
|
|
||||||
|
|
||||||
let auth = ns.Service.identity;
|
|
||||||
auth.account = username || "foo";
|
|
||||||
auth.basicPassword = password || "password";
|
|
||||||
auth.syncKey = syncKey || "foo";
|
|
||||||
|
|
||||||
ns.Service.serverURL = TEST_SERVER_URL;
|
|
||||||
ns.Service.clusterURL = TEST_CLUSTER_URL;
|
|
||||||
|
|
||||||
this.logStats = initTestLogging();
|
|
||||||
this.fakeFilesystem = new FakeFilesystemService({});
|
|
||||||
this.fakeGUIDService = new FakeGUIDService();
|
|
||||||
this.fakeCryptoService = new FakeCryptoService();
|
|
||||||
}
|
|
||||||
|
|
||||||
_("Setting the identity for passphrase");
|
_("Setting the identity for passphrase");
|
||||||
Cu.import("resource://services-sync/identity.js");
|
Cu.import("resource://services-sync/identity.js");
|
||||||
@ -181,17 +131,6 @@ Cu.import("resource://services-sync/identity.js");
|
|||||||
* Test setup helpers.
|
* Test setup helpers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Turn WBO cleartext into fake "encrypted" payload as it goes over the wire.
|
|
||||||
function encryptPayload(cleartext) {
|
|
||||||
if (typeof cleartext == "object") {
|
|
||||||
cleartext = JSON.stringify(cleartext);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {ciphertext: cleartext, // ciphertext == cleartext with fake crypto
|
|
||||||
IV: "irrelevant",
|
|
||||||
hmac: fakeSHA256HMAC(cleartext, Utils.makeHMACKey(""))};
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateNewKeys(collectionKeys, collections=null) {
|
function generateNewKeys(collectionKeys, collections=null) {
|
||||||
let wbo = collectionKeys.generateNewKeysWBO(collections);
|
let wbo = collectionKeys.generateNewKeysWBO(collections);
|
||||||
let modified = new_timestamp();
|
let modified = new_timestamp();
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
const Cm = Components.manager;
|
const Cm = Components.manager;
|
||||||
|
|
||||||
const TEST_CLUSTER_URL = "http://localhost:8080/";
|
|
||||||
const TEST_SERVER_URL = "http://localhost:8080/";
|
|
||||||
|
|
||||||
// Shared logging for all HTTP server functions.
|
// Shared logging for all HTTP server functions.
|
||||||
Cu.import("resource://services-common/log4moz.js");
|
Cu.import("resource://services-common/log4moz.js");
|
||||||
const SYNC_HTTP_LOGGER = "Sync.Test.Server";
|
const SYNC_HTTP_LOGGER = "Sync.Test.Server";
|
||||||
|
@ -10,6 +10,7 @@ Cu.import("resource://services-common/preferences.js");
|
|||||||
Cu.import("resource://services-sync/addonsreconciler.js");
|
Cu.import("resource://services-sync/addonsreconciler.js");
|
||||||
Cu.import("resource://services-sync/engines/addons.js");
|
Cu.import("resource://services-sync/engines/addons.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
let prefs = new Preferences();
|
let prefs = new Preferences();
|
||||||
prefs.set("extensions.getAddons.get.url",
|
prefs.set("extensions.getAddons.get.url",
|
||||||
|
@ -8,6 +8,7 @@ Cu.import("resource://services-sync/engines.js");
|
|||||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.register(BookmarksEngine);
|
Service.engineManager.register(BookmarksEngine);
|
||||||
var syncTesting = new SyncTestingInfrastructure();
|
var syncTesting = new SyncTestingInfrastructure();
|
||||||
|
@ -7,6 +7,7 @@ Cu.import("resource://services-sync/engines.js");
|
|||||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
|
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
|
||||||
var IOService = Cc["@mozilla.org/network/io-service;1"]
|
var IOService = Cc["@mozilla.org/network/io-service;1"]
|
||||||
|
@ -6,6 +6,7 @@ Cu.import("resource://services-sync/engines.js");
|
|||||||
Cu.import("resource://services-sync/engines/clients.js");
|
Cu.import("resource://services-sync/engines/clients.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const MORE_THAN_CLIENTS_TTL_REFRESH = 691200; // 8 days
|
const MORE_THAN_CLIENTS_TTL_REFRESH = 691200; // 8 days
|
||||||
const LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day
|
const LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
// Verify that we wipe the server if we have to regenerate keys.
|
// Verify that we wipe the server if we have to regenerate keys.
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
add_test(function test_missing_crypto_collection() {
|
add_test(function test_missing_crypto_collection() {
|
||||||
let johnHelper = track_collections_helper();
|
let johnHelper = track_collections_helper();
|
||||||
|
@ -10,6 +10,7 @@ Cu.import("resource://services-sync/record.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/status.js");
|
Cu.import("resource://services-sync/status.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
add_test(function test_locally_changed_keys() {
|
add_test(function test_locally_changed_keys() {
|
||||||
let passphrase = "abcdeabcdeabcdeabcdeabcdea";
|
let passphrase = "abcdeabcdeabcdeabcdeabcdea";
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-sync/engines.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
add_test(function test_processIncoming_abort() {
|
add_test(function test_processIncoming_abort() {
|
||||||
_("An abort exception, raised in applyIncoming, will abort _processIncoming.");
|
_("An abort exception, raised in applyIncoming, will abort _processIncoming.");
|
||||||
|
@ -7,6 +7,7 @@ Cu.import("resource://services-sync/keys.js");
|
|||||||
Cu.import("resource://services-sync/policies.js");
|
Cu.import("resource://services-sync/policies.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/status.js");
|
Cu.import("resource://services-sync/status.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const TEST_MAINTENANCE_URL = "http://localhost:8080/maintenance/";
|
const TEST_MAINTENANCE_URL = "http://localhost:8080/maintenance/";
|
||||||
const logsdir = FileUtils.getDir("ProfD", ["weave", "logs"], true);
|
const logsdir = FileUtils.getDir("ProfD", ["weave", "logs"], true);
|
||||||
|
@ -8,6 +8,8 @@ Cu.import("resource://services-sync/record.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/status.js");
|
Cu.import("resource://services-sync/status.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
initTestLogging("Trace");
|
initTestLogging("Trace");
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ Cu.import("resource://services-sync/engines.js");
|
|||||||
Cu.import("resource://services-sync/identity.js");
|
Cu.import("resource://services-sync/identity.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.clear();
|
Service.engineManager.clear();
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
|
||||||
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
// Track HMAC error counts.
|
// Track HMAC error counts.
|
||||||
let hmacErrorCount = 0;
|
let hmacErrorCount = 0;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://services-sync/engines/clients.js");
|
Cu.import("resource://services-sync/engines/clients.js");
|
||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Svc.DefaultPrefs.set("registerEngines", "");
|
Svc.DefaultPrefs.set("registerEngines", "");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
@ -3,6 +3,7 @@ Cu.import("resource://services-sync/identity.js");
|
|||||||
Cu.import("resource://services-sync/jpakeclient.js");
|
Cu.import("resource://services-sync/jpakeclient.js");
|
||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const JPAKE_LENGTH_SECRET = 8;
|
const JPAKE_LENGTH_SECRET = 8;
|
||||||
const JPAKE_LENGTH_CLIENTID = 256;
|
const JPAKE_LENGTH_CLIENTID = 256;
|
||||||
|
@ -34,6 +34,7 @@ const modules = [
|
|||||||
const testingModules = [
|
const testingModules = [
|
||||||
"fakeservices.js",
|
"fakeservices.js",
|
||||||
"rotaryengine.js",
|
"rotaryengine.js",
|
||||||
|
"utils.js",
|
||||||
];
|
];
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
|
@ -10,6 +10,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/status.js");
|
Cu.import("resource://services-sync/status.js");
|
||||||
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.clear();
|
Service.engineManager.clear();
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/resource.js");
|
Cu.import("resource://services-sync/resource.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const TEST_GET_URL = "http://localhost:8080/1.1/johndoe/storage/meta/global";
|
const TEST_GET_URL = "http://localhost:8080/1.1/johndoe/storage/meta/global";
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/status.js");
|
Cu.import("resource://services-sync/status.js");
|
||||||
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.clear();
|
Service.engineManager.clear();
|
||||||
Service.engineManager.register(RotaryEngine);
|
Service.engineManager.register(RotaryEngine);
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/jpakeclient.js");
|
Cu.import("resource://services-sync/jpakeclient.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
setBasicCredentials("johndoe", "ilovejane", Utils.generatePassphrase());
|
setBasicCredentials("johndoe", "ilovejane", Utils.generatePassphrase());
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
||||||
|
|
||||||
function test_urls() {
|
function test_urls() {
|
||||||
_("URL related Service properties corresopnd to preference settings.");
|
_("URL related Service properties corresopnd to preference settings.");
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-common/log4moz.js");
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
initTestLogging("Trace");
|
initTestLogging("Trace");
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
do_test_pending();
|
do_test_pending();
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function do_check_throws(func) {
|
function do_check_throws(func) {
|
||||||
var raised = false;
|
var raised = false;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
initTestLogging("Trace");
|
initTestLogging("Trace");
|
||||||
|
@ -8,6 +8,7 @@ Cu.import("resource://services-sync/engines/tabs.js");
|
|||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.register(TabEngine);
|
Service.engineManager.register(TabEngine);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-common/rest.js");
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
let collections = {steam: 65.11328,
|
let collections = {steam: 65.11328,
|
||||||
petrol: 82.488281,
|
petrol: 82.488281,
|
||||||
|
@ -6,6 +6,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/policies.js");
|
Cu.import("resource://services-sync/policies.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function login_handling(handler) {
|
function login_handling(handler) {
|
||||||
return function (request, response) {
|
return function (request, response) {
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-sync/resource.js");
|
Cu.import("resource://services-sync/resource.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const JAPANESE = "\u34ff\u35ff\u36ff\u37ff";
|
const JAPANESE = "\u34ff\u35ff\u36ff\u37ff";
|
||||||
const APPLES = "\uf8ff\uf8ff\uf8ff\uf8ff";
|
const APPLES = "\uf8ff\uf8ff\uf8ff\uf8ff";
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
try {
|
try {
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function BlaEngine() {
|
function BlaEngine() {
|
||||||
SyncEngine.call(this, "Bla", Service);
|
SyncEngine.call(this, "Bla", Service);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-common/observers.js");
|
Cu.import("resource://services-common/observers.js");
|
||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Svc.Prefs.set("registerEngines", "Tab,Bookmarks,Form,History");
|
Svc.Prefs.set("registerEngines", "Tab,Bookmarks,Form,History");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/policies.js");
|
Cu.import("resource://services-sync/policies.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function login_handling(handler) {
|
function login_handling(handler) {
|
||||||
return function (request, response) {
|
return function (request, response) {
|
||||||
|
@ -6,6 +6,8 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/keys.js");
|
Cu.import("resource://services-sync/keys.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
let logger = Log4Moz.repository.rootLogger;
|
let logger = Log4Moz.repository.rootLogger;
|
||||||
|
@ -7,6 +7,7 @@ Cu.import("resource://services-sync/engines/clients.js");
|
|||||||
Cu.import("resource://services-sync/record.js");
|
Cu.import("resource://services-sync/record.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
initTestLogging();
|
initTestLogging();
|
||||||
Service.engineManager.clear();
|
Service.engineManager.clear();
|
||||||
|
@ -5,6 +5,7 @@ Cu.import("resource://services-common/log4moz.js");
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function login_handling(handler) {
|
function login_handling(handler) {
|
||||||
return function (request, response) {
|
return function (request, response) {
|
||||||
|
@ -6,6 +6,7 @@ Cu.import("resource://services-sync/engines.js");
|
|||||||
Cu.import("resource://services-sync/record.js");
|
Cu.import("resource://services-sync/record.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.clear();
|
Service.engineManager.clear();
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
Cu.import("resource://services-sync/record.js");
|
Cu.import("resource://services-sync/record.js");
|
||||||
Cu.import("resource://services-sync/resource.js");
|
Cu.import("resource://services-sync/resource.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Svc.DefaultPrefs.set("registerEngines", "");
|
Svc.DefaultPrefs.set("registerEngines", "");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
Cu.import("resource://services-sync/engines.js");
|
Cu.import("resource://services-sync/engines.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function makeSteamEngine() {
|
function makeSteamEngine() {
|
||||||
return new SyncEngine('Steam', Service);
|
return new SyncEngine('Steam', Service);
|
||||||
|
@ -8,6 +8,7 @@ Cu.import("resource://services-sync/resource.js");
|
|||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
Cu.import("resource://testing-common/services/sync/rotaryengine.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
function makeRotaryEngine() {
|
function makeRotaryEngine() {
|
||||||
return new RotaryEngine(Service);
|
return new RotaryEngine(Service);
|
||||||
|
@ -8,6 +8,7 @@ Cu.import("resource://services-sync/policies.js");
|
|||||||
Cu.import("resource://services-sync/record.js");
|
Cu.import("resource://services-sync/record.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/status.js");
|
Cu.import("resource://services-sync/status.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
Service.engineManager.clear();
|
Service.engineManager.clear();
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ Cu.import("resource://services-sync/constants.js");
|
|||||||
Cu.import("resource://services-sync/rest.js");
|
Cu.import("resource://services-sync/rest.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
Cu.import("resource://services-sync/util.js");
|
Cu.import("resource://services-sync/util.js");
|
||||||
|
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||||
|
|
||||||
const STORAGE_REQUEST_RESOURCE_URL = TEST_SERVER_URL + "resource";
|
const STORAGE_REQUEST_RESOURCE_URL = TEST_SERVER_URL + "resource";
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
Cu.import("resource://services-sync/constants.js");
|
Cu.import("resource://services-sync/constants.js");
|
||||||
Cu.import("resource://services-sync/service.js");
|
Cu.import("resource://services-sync/service.js");
|
||||||
|
|
||||||
var btoa = Cu.import("resource://services-sync/util.js").btoa;
|
|
||||||
|
|
||||||
// Test upgrade of a dashed old-style sync key.
|
// Test upgrade of a dashed old-style sync key.
|
||||||
function run_test() {
|
function run_test() {
|
||||||
const PBKDF2_KEY_BYTES = 16;
|
const PBKDF2_KEY_BYTES = 16;
|
||||||
|
Loading…
Reference in New Issue
Block a user