Use do_get_profile() instead of CurProcD in test_privatebrowsing_downloadLastDir.js

RESOLVED FIXED in mozilla11

Status

()

Toolkit
Downloads API
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: darktrojan, Assigned: darktrojan)

Tracking

unspecified
mozilla11
Points:
---
Bug Flags:
in-testsuite -
in-litmus -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
Created attachment 574661 [details] [diff] [review]
patch

I'm not entirely sure why CurProcD was being used (I think it's from the time before do_get_profile), but it makes working on the download tests a pain because the profile is not cleaned up at the end of the test run.
Attachment #574661 - Flags: review?(gavin.sharp)
Comment on attachment 574661 [details] [diff] [review]
patch

>diff --git a/toolkit/mozapps/downloads/tests/unit/test_privatebrowsing_downloadLastDir.js b/toolkit/mozapps/downloads/tests/unit/test_privatebrowsing_downloadLastDir.js

>-      } else if (prop == "DLoads") {
>-        var file = dirSvc.get("CurProcD", Ci.nsILocalFile);
>-        file.append("downloads.rdf");

>+    if (prop == "DLoads") {
>+      return profileDir.clone();

This looks wrong. Is this directory service entry still used?

The rest of the patch looks OK.
Attachment #574661 - Flags: review?(gavin.sharp) → review-
(Assignee)

Comment 2

6 years ago
Created attachment 575546 [details] [diff] [review]
patch v2

Apparently not. I remember I took it out to start with, but then put it back for some reason. :-/
Attachment #574661 - Attachment is obsolete: true
Attachment #575546 - Flags: review?(gavin.sharp)
Similar code exists in test_privatebrowsing_downloadLastDir_c.js, can we clean that up too?
(Assignee)

Comment 4

6 years ago
Created attachment 575699 [details] [diff] [review]
patch v3

(In reply to Gavin Sharp (use gavin@gavinsharp.com for email) from comment #3)
> Similar code exists in test_privatebrowsing_downloadLastDir_c.js, can we
> clean that up too?

Oh yeah, forgot about that one.
Attachment #575546 - Attachment is obsolete: true
Attachment #575546 - Flags: review?(gavin.sharp)
Attachment #575699 - Flags: review?(gavin.sharp)
Attachment #575699 - Flags: review?(gavin.sharp) → review+
(Assignee)

Comment 5

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/085907160178
Flags: in-testsuite-
Flags: in-litmus-
Target Milestone: --- → mozilla11

Comment 6

6 years ago
https://hg.mozilla.org/mozilla-central/rev/085907160178
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.