mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 722995 - Part 5: Make the tests compatible to the code changes, r=ehsan
This commit is contained in:
parent
c04ff46abb
commit
2351cc3afd
@ -3,10 +3,12 @@
|
||||
* 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/. */
|
||||
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
let downloadModule = {};
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm", downloadModule);
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
let gDownloadLastDir = new downloadModule.DownloadLastDir(window);
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
@ -216,6 +218,5 @@ function test() {
|
||||
Services.prefs.clearUserPref("browser.download.lastDir");
|
||||
gDownloadLastDir.cleanupPrivateFile();
|
||||
delete FileUtils;
|
||||
delete gDownloadLastDir;
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,10 @@
|
||||
* 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/. */
|
||||
|
||||
let downloadModule = {};
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm", downloadModule);
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://mochikit/MockFilePicker.jsm");
|
||||
|
||||
@ -14,6 +15,7 @@ let launcher = {
|
||||
};
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
let gDownloadLastDir = new downloadModule.DownloadLastDir(window);
|
||||
|
||||
MockFilePicker.init();
|
||||
MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
|
||||
@ -52,7 +54,6 @@ function test() {
|
||||
MockFilePicker.cleanup();
|
||||
gDownloadLastDir.cleanupPrivateFile();
|
||||
delete FileUtils;
|
||||
delete gDownloadLastDir;
|
||||
});
|
||||
|
||||
let context = gBrowser.selectedBrowser.contentWindow;
|
||||
|
@ -3,13 +3,15 @@
|
||||
* 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/. */
|
||||
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
let downloadModule = {};
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm", downloadModule);
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://mochikit/MockFilePicker.jsm");
|
||||
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
let gDownloadLastDir = new downloadModule.DownloadLastDir(window);
|
||||
|
||||
MockFilePicker.init();
|
||||
MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
|
||||
@ -52,7 +54,6 @@ function test() {
|
||||
validateFileName = validateFileNameToRestore;
|
||||
gDownloadLastDir.cleanupPrivateFile();
|
||||
delete FileUtils;
|
||||
delete gDownloadLastDir;
|
||||
});
|
||||
|
||||
// Overwrite stringBundle to return an object masquerading as a string bundle
|
||||
|
@ -3,10 +3,12 @@
|
||||
* 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/. */
|
||||
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
let downloadModule = {};
|
||||
Cu.import("resource://gre/modules/DownloadLastDir.jsm", downloadModule);
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
let gDownloadLastDir = new downloadModule.DownloadLastDir(window);
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
@ -27,7 +29,6 @@ function test() {
|
||||
newDir.remove(true);
|
||||
gDownloadLastDir.cleanupPrivateFile();
|
||||
delete FileUtils;
|
||||
delete gDownloadLastDir;
|
||||
});
|
||||
|
||||
newDir.append("testdir");
|
||||
|
Loading…
Reference in New Issue
Block a user