Bug 587901 - test and nsSidebar.js fixes. r+a=dolske

This commit is contained in:
Dão Gottwald 2010-09-08 15:30:44 +02:00
Родитель b29b321fae
Коммит 0d50508fa8
3 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -36,7 +36,7 @@ var iconDiscoveryTests = [
function runIconDiscoveryTest() {
var test = iconDiscoveryTests[0];
var head = doc().getElementById("linkparent");
var hasSrc = gProxyFavIcon.hasAttribute("src");
var hasSrc = gBrowser.getIcon() != null;
if (test.pass)
ok(hasSrc, test.text);
else
@ -50,7 +50,7 @@ function runIconDiscoveryTest() {
function iconDiscovery() {
setHandlerFunc(runIconDiscoveryTest);
if (iconDiscoveryTests.length) {
gProxyFavIcon.removeAttribute("src");
gBrowser.setIcon(gBrowser.selectedTab, null);
var test = iconDiscoveryTests[0];
var head = doc().getElementById("linkparent");

Просмотреть файл

@ -197,7 +197,7 @@ function (aDescriptionURL)
if (browser.shouldLoadFavIcon(browser.selectedBrowser
.contentDocument
.documentURIObject))
iconURL = win.gProxyFavIcon.getAttribute("src");
iconURL = win.gBrowser.getIcon();
if (!this.validateSearchEngine(aDescriptionURL, iconURL))
return;

Просмотреть файл

@ -5,29 +5,23 @@
function test() {
waitForExplicitFinish();
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 1);
Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.addObserver(function (theSubject, theTopic, theData) {
Services.obs.addObserver(function (theSubject, theTopic, theData) {
var uri = theSubject.QueryInterface(Components.interfaces.nsIURI);
var domain = uri.host;
if (domain == "example.org") {
ok(true, "foreign favicon cookie was blocked");
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setIntPref("network.cookie.cookieBehavior", 0);
Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
os.removeObserver(arguments.callee, "cookie-rejected");
Services.obs.removeObserver(arguments.callee, "cookie-rejected");
finish();
}
}, "cookie-rejected", false);
// kick off a favicon load
PageProxySetIcon("http://example.org/tests/extensions/cookie/test/damonbowling.jpg");
gBrowser.setIcon(gBrowser.selectedTab, "http://example.org/tests/extensions/cookie/test/damonbowling.jpg");
}