mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 887404 - Allow test_browserGlue_distribution.js to run parallel to other tests.
r=gavin
This commit is contained in:
parent
c7b77cbe6d
commit
d4bf5ac8b8
@ -13,13 +13,21 @@ const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC =
|
||||
"distribution-customization-complete";
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
this.DistributionCustomizer = function DistributionCustomizer() {
|
||||
// For parallel xpcshell testing purposes allow loading the distribution.ini
|
||||
// file from the profile folder through an hidden pref.
|
||||
let loadFromProfile = false;
|
||||
try {
|
||||
loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile");
|
||||
} catch(ex) {}
|
||||
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties);
|
||||
let iniFile = dirSvc.get("XREExeF", Ci.nsIFile);
|
||||
let iniFile = loadFromProfile ? dirSvc.get("ProfD", Ci.nsIFile)
|
||||
: dirSvc.get("XREExeF", Ci.nsIFile);
|
||||
iniFile.leafName = "distribution";
|
||||
iniFile.append("distribution.ini");
|
||||
if (iniFile.exists())
|
||||
|
@ -17,8 +17,10 @@ function run_test()
|
||||
{
|
||||
do_test_pending();
|
||||
|
||||
// Copy distribution.ini file to our app dir.
|
||||
let distroDir = Services.dirsvc.get("XREExeF", Ci.nsIFile);
|
||||
// Set special pref to load distribution.ini from the profile folder.
|
||||
Services.prefs.setBoolPref("distribution.testing.loadFromProfile", true);
|
||||
// Copy distribution.ini file to the profile dir.
|
||||
let distroDir = gProfD.clone();
|
||||
distroDir.leafName = "distribution";
|
||||
let iniFile = distroDir.clone();
|
||||
iniFile.append("distribution.ini");
|
||||
@ -94,7 +96,7 @@ function onCustomizationComplete()
|
||||
do_register_cleanup(function() {
|
||||
// Remove the distribution file, even if the test failed, otherwise all
|
||||
// next tests will import it.
|
||||
let iniFile = Services.dirsvc.get("XREExeF", Ci.nsIFile);
|
||||
let iniFile = gProfD.clone();
|
||||
iniFile.leafName = "distribution";
|
||||
iniFile.append("distribution.ini");
|
||||
if (iniFile.exists())
|
||||
|
Loading…
Reference in New Issue
Block a user