Closed Bug 573061 Opened 10 years ago Closed 10 years ago

Add persistent cookie tests

Categories

(Core :: Networking: Cookies, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dwitte, Assigned: dwitte)

Details

Attachments

(2 files)

No description provided.
Attachment #452289 - Flags: review?(sdwilsh)
Attached patch persistent testsSplinter Review
Attachment #452290 - Flags: review?(sdwilsh)
Attachment #452289 - Flags: review?(sdwilsh) → review+
Comment on attachment 452289 [details] [diff] [review]
cookieservice notify on db close

>+static CloseCookieDBListener sCloseCookieDBListener;
Can we move this somewhere else so it isn't initialized at library load (taras doesn't want us to do this anymore, and it's also in the portability guide)

r=sdwilsh
Comment on attachment 452290 [details] [diff] [review]
persistent tests

>+++ b/extensions/cookie/test/unit/head_cookies.js
>+const _Cc = Components.classes;
>+const _Ci = Components.interfaces;
Why _Cc instead of Cc like we do everywhere else?

>+// Close and reload the cookie database.
>+function do_reload_profile(generator, profile, service, cleanse) {
>+  function _observer(generator, service, topic) {
>+    this.os = _Cc["@mozilla.org/observer-service;1"].
>+              getService(_Ci.nsIObserverService);
This is provided by Services.jsm.

>+++ b/extensions/cookie/test/unit/test_cookies_persistence.js
nit: no license block in this file

>+const Cc = Components.classes;
>+const Ci = Components.interfaces;
If you declare this in the head_ file, you don't have to here.

>+  // Create URIs and channels pointing to foo.com and bar.com.
>+  // We will use these to put foo.com into first and third party contexts.
>+  var spec1 = "http://foo.com/foo.html";
>+  var spec2 = "http://bar.com/bar.html";
>+  var uri1 = ios.newURI(spec1, null, null);
>+  var uri2 = ios.newURI(spec2, null, null);
>+  var channel1 = ios.newChannelFromURI(uri1);
>+  var channel2 = ios.newChannelFromURI(uri2);
NetUtil.newChannel(uri1);
NetUtil.newChannel(uri2);

>+++ b/extensions/cookie/test/unit/test_cookies_thirdparty.js
nit: no license block on this file
>@@ -17,50 +17,42 @@ function run_test() {
>   var spec2 = "http://bar.com/bar.html";
>   var uri1 = ios.newURI(spec1, null, null);
>   var uri2 = ios.newURI(spec2, null, null);
>   var channel1 = ios.newChannelFromURI(uri1);
>   var channel2 = ios.newChannelFromURI(uri2);
ditto on NetUtil

>+++ b/extensions/cookie/test/unit/test_cookies_thirdparty_session.js
nit: license

>+  var spec1 = "http://foo.com/foo.html";
>+  var spec2 = "http://bar.com/bar.html";
>+  var uri1 = ios.newURI(spec1, null, null);
>+  var uri2 = ios.newURI(spec2, null, null);
>+  var channel1 = ios.newChannelFromURI(uri1);
>+  var channel2 = ios.newChannelFromURI(uri2);
ditto on NetUtil stuff

r=sdwilsh
Attachment #452290 - Flags: review?(sdwilsh) → review+
http://hg.mozilla.org/mozilla-central/rev/f4bd9605e451
http://hg.mozilla.org/mozilla-central/rev/4f1f2e61ca9e

Pushed with fixes.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.