mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 847863 - Part 1 of 8 - Selectively disable old Download Manager xpcshell tests. r=enn
This commit is contained in:
parent
4979cc99bd
commit
cffd53387c
@ -240,3 +240,12 @@ Services.prefs.setBoolPref("browser.download.manager.showAlertOnComplete", false
|
||||
do_register_cleanup(function() {
|
||||
Services.obs.notifyObservers(null, "quit-application", null);
|
||||
});
|
||||
|
||||
function oldDownloadManagerDisabled() {
|
||||
try {
|
||||
if (Services.prefs.getBoolPref("browser.download.useJSTransfer")) {
|
||||
return true;
|
||||
}
|
||||
} catch (ex) { }
|
||||
return false;
|
||||
}
|
@ -39,6 +39,10 @@ var tests = [test_retry_canceled, test_retry_bad];
|
||||
var httpserv = null;
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
httpserv = new HttpServer();
|
||||
httpserv.registerDirectory("/", do_get_cwd());
|
||||
httpserv.start(-1);
|
||||
|
@ -30,6 +30,10 @@ var httpserv = null;
|
||||
var timer = null;
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
httpserv = new HttpServer();
|
||||
httpserv.registerDirectory("/", do_get_cwd());
|
||||
httpserv.start(-1);
|
||||
|
@ -76,6 +76,10 @@ function checkRecentDocsFor(aFileName) {
|
||||
var httpserv = null;
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This test functionality only implemented on Windows.
|
||||
// Is there a better way of doing this?
|
||||
var httpPH = Cc["@mozilla.org/network/protocol;1?name=http"].
|
||||
|
@ -27,6 +27,10 @@ var tests = [test_noScanningDownloads];
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < tests.length; i++)
|
||||
tests[i]();
|
||||
}
|
||||
|
@ -9,6 +9,10 @@
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let dm = Cc["@mozilla.org/download-manager;1"].
|
||||
getService(Ci.nsIDownloadManager);
|
||||
let db = dm.DBConnection;
|
||||
|
@ -9,6 +9,10 @@ importDownloadsFile("bug_409179_downloads.sqlite");
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var caughtException = false;
|
||||
try {
|
||||
var dm = Cc["@mozilla.org/download-manager;1"].
|
||||
|
@ -10,6 +10,10 @@ const dm = Cc["@mozilla.org/download-manager;1"].getService(nsIDownloadManager);
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't finish until the download is finished
|
||||
do_test_pending();
|
||||
|
||||
|
@ -123,6 +123,10 @@ let tests = [
|
||||
];
|
||||
|
||||
function run_test() {
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// setup a download listener to run tests during and after the download
|
||||
DownloadListener.init();
|
||||
Services.prefs.setBoolPref("browser.download.manager.showWhenStarting", false);
|
||||
|
@ -96,6 +96,10 @@ var tests = [test_get_download_empty_queue, test_connection,
|
||||
var httpserv = null;
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
httpserv = new HttpServer();
|
||||
httpserv.registerDirectory("/", do_get_cwd());
|
||||
httpserv.start(-1);
|
||||
|
@ -145,6 +145,10 @@ let tests = [
|
||||
];
|
||||
|
||||
function run_test() {
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// setup a download listener to run tests after each download finished
|
||||
DownloadListener.init();
|
||||
Services.prefs.setBoolPref("browser.download.manager.showWhenStarting", false);
|
||||
|
@ -6,6 +6,10 @@ const dm = Cc["@mozilla.org/download-manager;1"].getService(Ci.nsIDownloadManage
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let server = new HttpServer();
|
||||
server.start(-1);
|
||||
let dl = addDownload(server);
|
||||
|
@ -26,6 +26,10 @@ function getExpirablePRTime() {
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,9 @@ const nsIDM = Ci.nsIDownloadManager;
|
||||
const nsIWBP = Ci.nsIWebBrowserPersist;
|
||||
const nsIWPL = Ci.nsIWebProgressListener;
|
||||
const dm = Cc["@mozilla.org/download-manager;1"].getService(nsIDM);
|
||||
dm.cleanUp();
|
||||
if (!oldDownloadManagerDisabled()) {
|
||||
dm.cleanUp();
|
||||
}
|
||||
|
||||
function setOnlineState(aOnline)
|
||||
{
|
||||
@ -36,6 +38,10 @@ function setOnlineState(aOnline)
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Create data for http server to send
|
||||
*/
|
||||
|
@ -7,6 +7,10 @@
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the downloads.rdf file
|
||||
importDownloadsFile("empty_downloads.rdf");
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
// Private resumed request sends times=1 cookie, completes
|
||||
|
||||
function run_test() {
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow all cookies.
|
||||
Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
|
||||
|
||||
|
@ -79,6 +79,10 @@ function is_download_available(aGUID, aSrc, aDst, aName, aPrivate, present) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let prefBranch = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
|
||||
|
@ -77,6 +77,10 @@ function trigger_pb_cleanup(expected)
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
function finishTest() {
|
||||
// Cancel Download-G
|
||||
dlG.cancel();
|
||||
|
@ -155,6 +155,10 @@ let tests = [
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < tests.length; i++) {
|
||||
dm.cleanUp();
|
||||
tests[i]();
|
||||
|
@ -17,6 +17,10 @@ const dm = Cc["@mozilla.org/download-manager;1"].getService(nsIDM);
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Create data for http server to send
|
||||
*/
|
||||
|
@ -18,7 +18,9 @@ const nsIDM = Ci.nsIDownloadManager;
|
||||
const nsIWBP = Ci.nsIWebBrowserPersist;
|
||||
const nsIWPL = Ci.nsIWebProgressListener;
|
||||
const dm = Cc["@mozilla.org/download-manager;1"].getService(nsIDM);
|
||||
dm.cleanUp();
|
||||
if (!oldDownloadManagerDisabled()) {
|
||||
dm.cleanUp();
|
||||
}
|
||||
|
||||
function notify(aTopic)
|
||||
{
|
||||
@ -29,6 +31,10 @@ function notify(aTopic)
|
||||
|
||||
function run_test()
|
||||
{
|
||||
if (oldDownloadManagerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0. Speed up the resume on wake delay from 10 seconds
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user