Closed Bug 463127 Opened 16 years ago Closed 9 years ago

nsICookieManager/CookieService should allow creation of arbitrary cookies for testing

Categories

(Core :: Networking: Cookies, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: johnath, Unassigned)

Details

Writing tests for bug 453440, I needed to create cookies with arbitrary creation times, so that I could test clear private data's time-based functionality. For downloads I can access the database to do this, with places I can do something similar, but the add/setCookieString functions don't support alternate creation time. If we resolve this bug to provide that mechanism, we should also update the tests added in bug 453440.
easy enough to add a creationtime arg to the add() method, though i'm not sure exactly how we'd do it neatly so consumers who want to use the current time don't have to jump through hoops... (or perhaps a single hoop, since getting the time in ms and multiplying by 1000 isn't that hard in js)
Yeah, and given that it's only really needed for testing, it might make more sense to do something more primitive - expose the dbconnection like nsIDownloadManager does, maybe?
nope, since cookies has its own in-memory store, the db is just the on-disk part of it. so we need the API to provide this specifically. having two methods that do almost exactly the same thing would be a bit weird, but if there are other reasons to do it, then sure...
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.