зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 655b8b4a0e67 (bug 1503696) for failing eslint at gecko/browser/base/content/test/favicons/browser_favicon_cache.js on a CLOSED TREE
This commit is contained in:
Родитель
7b12453efb
Коммит
6cebff1713
|
@ -62,7 +62,3 @@ support-files =
|
|||
file_with_slow_favicon.html
|
||||
blank.html
|
||||
file_favicon.png
|
||||
[browser_favicon_cache.js]
|
||||
support-files =
|
||||
cookie_favicon.sjs
|
||||
cookie_favicon.html
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
add_task(async () => {
|
||||
const testPath = "http://example.com/browser/browser/base/content/test/favicons/cookie_favicon.html";
|
||||
const testUrl = Services.io.newURI(testPath);
|
||||
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, testPath);
|
||||
gBrowser.selectedTab = tab;
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
let faviconPromise = waitForLinkAvailable(browser);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
await faviconPromise;
|
||||
let cookies = Services.cookies.getCookiesFromHost("example.com", browser.contentPrincipal.originAttributes);
|
||||
let seenCookie = false;
|
||||
for (let cookie of cookies) {
|
||||
if (cookie.name == "faviconCookie") {
|
||||
seenCookie = true;
|
||||
is(cookie.value, 1, "Should have seen the right initial cookie.");
|
||||
}
|
||||
}
|
||||
ok(seenCookie, "Should have seen the cookie.");
|
||||
|
||||
faviconPromise = waitForLinkAvailable(browser);
|
||||
BrowserTestUtils.loadURI(browser, testPath);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
await faviconPromise;
|
||||
cookies = Services.cookies.getCookiesFromHost("example.com", browser.contentPrincipal.originAttributes);
|
||||
seenCookie = false;
|
||||
for (let cookie of cookies) {
|
||||
if (cookie.name == "faviconCookie") {
|
||||
seenCookie = true;
|
||||
is(cookie.value, 1, "Should have seen the cached cookie.");
|
||||
}
|
||||
}
|
||||
ok(seenCookie, "Should have seen the cookie.");
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>Favicon Test for caching</title>
|
||||
<link rel="icon" type="image/png" href="cookie_favicon.sjs" />
|
||||
</head>
|
||||
<body>
|
||||
Favicon!!
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
function handleRequest(request, response) {
|
||||
let state = getState("cache_cookie");
|
||||
if (!state) {
|
||||
state = 0;
|
||||
}
|
||||
|
||||
response.setStatusLine(request.httpVersion, 302, "Moved Temporarily");
|
||||
response.setHeader("Set-Cookie", `faviconCookie=${++state}`);
|
||||
response.setHeader("Location", "http://example.com/browser/browser/base/content/test/favicons/moz.png");
|
||||
setState("cache_cookie", `${state}`);
|
||||
}
|
|
@ -78,9 +78,7 @@ class FaviconLoad {
|
|||
Ci.nsILoadInfo.SEC_DISALLOW_SCRIPT),
|
||||
Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON);
|
||||
|
||||
this.channel.loadFlags |= Ci.nsIRequest.LOAD_BACKGROUND |
|
||||
Ci.nsIRequest.VALIDATE_NEVER |
|
||||
Ci.nsIRequest.LOAD_FROM_CACHE;
|
||||
this.channel.loadFlags |= Ci.nsIRequest.LOAD_BACKGROUND;
|
||||
// Sometimes node is a document and sometimes it is an element. This is
|
||||
// the easiest single way to get to the load group in both those cases.
|
||||
this.channel.loadGroup = iconInfo.node.ownerGlobal.document.documentLoadGroup;
|
||||
|
|
Загрузка…
Ссылка в новой задаче