2008-03-12 00:53:50 -07:00
|
|
|
// tests third party cookie blocking using a favicon load directly from chrome.
|
|
|
|
// in this case, the docshell of the channel is chrome, not content; thus
|
|
|
|
// the cookie should be considered third party.
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
2010-09-08 06:30:44 -07:00
|
|
|
Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
|
2008-03-12 00:53:50 -07:00
|
|
|
|
2010-09-08 06:30:44 -07:00
|
|
|
Services.obs.addObserver(function (theSubject, theTopic, theData) {
|
2008-03-12 00:53:50 -07:00
|
|
|
var uri = theSubject.QueryInterface(Components.interfaces.nsIURI);
|
|
|
|
var domain = uri.host;
|
|
|
|
|
|
|
|
if (domain == "example.org") {
|
|
|
|
ok(true, "foreign favicon cookie was blocked");
|
|
|
|
|
2010-09-08 06:30:44 -07:00
|
|
|
Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
|
2008-03-12 00:53:50 -07:00
|
|
|
|
2010-09-08 06:30:44 -07:00
|
|
|
Services.obs.removeObserver(arguments.callee, "cookie-rejected");
|
2008-03-12 00:53:50 -07:00
|
|
|
|
|
|
|
finish();
|
|
|
|
}
|
2010-02-06 00:47:42 -08:00
|
|
|
}, "cookie-rejected", false);
|
2008-03-12 00:53:50 -07:00
|
|
|
|
2010-02-06 00:47:42 -08:00
|
|
|
// kick off a favicon load
|
2010-09-08 06:30:44 -07:00
|
|
|
gBrowser.setIcon(gBrowser.selectedTab, "http://example.org/tests/extensions/cookie/test/damonbowling.jpg");
|
2010-02-06 00:47:42 -08:00
|
|
|
}
|