mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00
Bug 573679 - Fix tests to pass on trunk
Use do_load_httpd_js for xpcshell tests and have consumers directly call new nsHttpServer().
This commit is contained in:
parent
cccc303a13
commit
9dfb68cb2a
@ -1,7 +1,14 @@
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
// Load httpd from the add-on test harness or from xpcshell and declare Cc, etc.
|
||||
// without a var/const so they don't get hoisted and conflict with load_httpd.
|
||||
if (this.do_load_httpd_js == null) {
|
||||
Cc = Components.classes;
|
||||
Ci = Components.interfaces;
|
||||
Cr = Components.results;
|
||||
Cu = Components.utils;
|
||||
Cu.import("resource://harness/modules/httpd.js");
|
||||
}
|
||||
else
|
||||
do_load_httpd_js();
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
let Httpd = {};
|
||||
Cu.import("resource://harness/modules/httpd.js", Httpd);
|
||||
|
||||
function httpd_setup (handlers) {
|
||||
let server = new Httpd.nsHttpServer();
|
||||
let server = new nsHttpServer();
|
||||
for (let path in handlers) {
|
||||
server.registerPathHandler(path, handlers[path]);
|
||||
}
|
||||
|
@ -5,8 +5,6 @@ Cu.import("resource://services-sync/resource.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
let logger;
|
||||
let Httpd = {};
|
||||
Cu.import("resource://harness/modules/httpd.js", Httpd);
|
||||
|
||||
function server_handler(metadata, response) {
|
||||
let body;
|
||||
@ -31,7 +29,7 @@ function run_test() {
|
||||
logger = Log4Moz.repository.getLogger('Test');
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
|
||||
let server = new Httpd.nsHttpServer();
|
||||
let server = new nsHttpServer();
|
||||
server.registerPathHandler("/foo", server_handler);
|
||||
server.start(8080);
|
||||
|
||||
|
@ -161,3 +161,12 @@ function test_sync() {
|
||||
engineObserver.reset();
|
||||
}
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
test_members();
|
||||
test_score();
|
||||
test_resetClient();
|
||||
test_wipeClient();
|
||||
test_enabled();
|
||||
test_sync();
|
||||
}
|
||||
|
@ -6,8 +6,6 @@ Cu.import("resource://services-sync/resource.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
let logger;
|
||||
let Httpd = {};
|
||||
Cu.import("resource://harness/modules/httpd.js", Httpd);
|
||||
|
||||
function server_open(metadata, response) {
|
||||
let body;
|
||||
@ -131,7 +129,7 @@ function run_test() {
|
||||
logger = Log4Moz.repository.getLogger('Test');
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
|
||||
let server = new Httpd.nsHttpServer();
|
||||
let server = new nsHttpServer();
|
||||
server.registerPathHandler("/open", server_open);
|
||||
server.registerPathHandler("/protected", server_protected);
|
||||
server.registerPathHandler("/404", server_404);
|
||||
|
@ -193,3 +193,10 @@ function test_locked() {
|
||||
Weave.Service.unlock();
|
||||
do_check_eq(Weave.Service.locked, false);
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
test_urlsAndIdentities();
|
||||
test_syncID();
|
||||
test_prefAttributes();
|
||||
test_locked();
|
||||
}
|
||||
|
@ -144,3 +144,9 @@ function test_updateCluster() {
|
||||
server.stop(function() {});
|
||||
}
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
test_findCluster();
|
||||
test_setCluster();
|
||||
test_updateCluster();
|
||||
}
|
||||
|
@ -111,3 +111,11 @@ function test_resetClient() {
|
||||
Svc.Prefs.resetBranch("");
|
||||
}
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
test_url_attributes();
|
||||
test_syncID();
|
||||
test_lastSync();
|
||||
test_toFetch();
|
||||
test_resetClient();
|
||||
}
|
||||
|
@ -1007,3 +1007,21 @@ function test_syncFinish_deleteLotsInBatches() {
|
||||
syncTesting = new SyncTestingInfrastructure(makeSteamEngine);
|
||||
}
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
test_syncStartup_emptyOrOutdatedGlobalsResetsSync();
|
||||
test_syncStartup_metaGet404();
|
||||
test_syncStartup_failedMetaGet();
|
||||
test_syncStartup_serverHasNewerVersion();
|
||||
test_syncStartup_syncIDMismatchResetsClient();
|
||||
test_syncStartup_badKeyWipesServerData();
|
||||
test_processIncoming_emptyServer();
|
||||
test_processIncoming_createFromServer();
|
||||
test_processIncoming_reconcile();
|
||||
test_processIncoming_fetchNum();
|
||||
test_uploadOutgoing_toEmptyServer();
|
||||
test_uploadOutgoing_MAX_UPLOAD_RECORDS();
|
||||
test_syncFinish_noDelete();
|
||||
test_syncFinish_deleteByIds();
|
||||
test_syncFinish_deleteLotsInBatches();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user