Bug 847863 - Part 3 of 8 - Selectively disable old Download Manager UI tests. r=enn

This commit is contained in:
Paolo Amadini 2013-08-19 17:23:59 +02:00
Родитель a49967ec81
Коммит 4d8e7c0a31
3 изменённых файлов: 21 добавлений и 1 удалений

Просмотреть файл

@ -115,6 +115,13 @@ let downloadListener = {
};
function init() {
var dmui = getDMUI();
if (!dmui) {
todo(false, "skip test for toolkit download manager UI");
SimpleTest.finish();
return;
}
// Ensure that the download manager callbacks always use the window UI instead
// of the panel in the browser's window.
Services.prefs.setBoolPref("browser.download.useToolkitUI", true);

Просмотреть файл

@ -68,6 +68,13 @@ let windowObserver = {
};
function init() {
var dmui = getDMUI();
if (!dmui) {
todo(false, "skip test for toolkit download manager UI");
SimpleTest.finish();
return;
}
ww.registerNotification(windowObserver);
loadNextTest();
}

Просмотреть файл

@ -10,6 +10,8 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
Components.utils.import("resource://gre/modules/Services.jsm");
/**
* Returns the toolkit implementation of the download manager UI service.
* If the toolkit implementation of the service can't be found (e.g. because
@ -20,6 +22,11 @@ const Cr = Components.results;
*/
function getDMUI()
{
try {
if (Services.prefs.getBoolPref("browser.download.useJSTransfer")) {
return false;
}
} catch (ex) { }
if (Components.classesByID["{7dfdf0d1-aff6-4a34-bad1-d0fe74601642}"])
return Components.classesByID["{7dfdf0d1-aff6-4a34-bad1-d0fe74601642}"].
getService(Ci.nsIDownloadManagerUI);
@ -144,7 +151,6 @@ function setCleanState()
*/
function waitForClearHistory(aCallback) {
Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Services.obs.addObserver(function observeClearHistory(aSubject, aTopic) {
Services.obs.removeObserver(observeClearHistory, aTopic);
aCallback();