1 // tests third party cookie blocking using a favicon load directly from chrome.
2 // in this case, the docshell of the channel is chrome, not content; thus
3 // the cookie should be considered third party.
6 waitForExplicitFinish();
8 var prefs
= Components
.classes
["@mozilla.org/preferences-service;1"]
9 .getService(Components
.interfaces
.nsIPrefBranch
);
10 prefs
.setIntPref("network.cookie.cookieBehavior", 1);
14 // kick off a favicon load
15 PageProxySetIcon("http://example.org/tests/extensions/cookie/test/image1.png");
19 this.os
= Components
.classes
["@mozilla.org/observer-service;1"]
20 .getService(Components
.interfaces
.nsIObserverService
);
21 this.os
.addObserver(this, "cookie-rejected", false);
25 observe
: function obs_observe (theSubject
, theTopic
, theData
)
27 var uri
= theSubject
.QueryInterface(Components
.interfaces
.nsIURI
);
28 var domain
= uri
.host
;
30 if (domain
== "example.org") {
31 ok(true, "foreign favicon cookie was blocked");
33 var prefs
= Components
.classes
["@mozilla.org/preferences-service;1"]
34 .getService(Components
.interfaces
.nsIPrefBranch
);
35 prefs
.setIntPref("network.cookie.cookieBehavior", 0);
37 this.os
.removeObserver(this, "cookie-rejected");