extensions/cookie/test/browser_test_favicon.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:cfa55055ea8d
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.
4
5 function test() {
6 waitForExplicitFinish();
7
8 Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
9
10 Services.obs.addObserver(function (theSubject, theTopic, theData) {
11 var uri = theSubject.QueryInterface(Components.interfaces.nsIURI);
12 var domain = uri.host;
13
14 if (domain == "example.org") {
15 ok(true, "foreign favicon cookie was blocked");
16
17 Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
18
19 Services.obs.removeObserver(arguments.callee, "cookie-rejected");
20
21 finish();
22 }
23 }, "cookie-rejected", false);
24
25 // kick off a favicon load
26 gBrowser.setIcon(gBrowser.selectedTab, "http://example.org/tests/extensions/cookie/test/damonbowling.jpg");
27 }

mercurial