diff --git a/toolkit/mozapps/downloads/tests/browser/Makefile.in b/toolkit/mozapps/downloads/tests/browser/Makefile.in index 75096185cf33..08b43322ffa2 100644 --- a/toolkit/mozapps/downloads/tests/browser/Makefile.in +++ b/toolkit/mozapps/downloads/tests/browser/Makefile.in @@ -45,10 +45,9 @@ relativesrcdir = toolkit/mozapps/downloads/tests/browser include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk -# XXX this test currently fails on windows -#_BROWSER_FILES = \ -# browser_basic_functionality.js -# $(NULL) +_BROWSER_FILES = \ + browser_basic_functionality.js \ + $(NULL) -#libs:: $(_BROWSER_FILES) -# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) +libs:: $(_BROWSER_FILES) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) diff --git a/toolkit/mozapps/downloads/tests/browser/browser_basic_functionality.js b/toolkit/mozapps/downloads/tests/browser/browser_basic_functionality.js index 5cfc98b12100..a753c043d93c 100644 --- a/toolkit/mozapps/downloads/tests/browser/browser_basic_functionality.js +++ b/toolkit/mozapps/downloads/tests/browser/browser_basic_functionality.js @@ -35,39 +35,46 @@ * * ***** END LICENSE BLOCK ***** */ +var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); +var dmFile = Cc["@mozilla.org/file/directory_service;1"]. + getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile); +dmFile.append("dmuitest.file"); +dmFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); +var gTestPath = ios.newFileURI(dmFile).spec; + const DownloadData = [ /* Active states first */ { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859239, state: Ci.nsIDownloadManager.DOWNLOAD_NOTSTARTED, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859238, state: Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859237, state: Ci.nsIDownloadManager.DOWNLOAD_PAUSED, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859236, state: Ci.nsIDownloadManager.DOWNLOAD_SCANNING, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859235, state: Ci.nsIDownloadManager.DOWNLOAD_QUEUED, @@ -75,35 +82,35 @@ const DownloadData = [ /* Finished states */ { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859234, state: Ci.nsIDownloadManager.DOWNLOAD_FINISHED, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859233, state: Ci.nsIDownloadManager.DOWNLOAD_FAILED, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859232, state: Ci.nsIDownloadManager.DOWNLOAD_CANCELED, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859231, state: Ci.nsIDownloadManager.DOWNLOAD_BLOCKED, currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 }, { name: "381603.patch", source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", - target: "file:///Users/sdwilsh/Desktop/381603.patch", + target: gTestPath, startTime: 1180493839859230, endTime: 1180493839859230, state: Ci.nsIDownloadManager.DOWNLOAD_DIRTY,