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