зеркало из https://github.com/mozilla/gecko-dev.git
Bug 587901 - test and nsSidebar.js fixes. r+a=dolske
This commit is contained in:
Родитель
b29b321fae
Коммит
0d50508fa8
|
@ -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");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче