forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
215 changed files
with
4,171 additions
and
2,209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
browser/base/content/test/general/browser_favicon_change_not_in_document.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"use strict"; | ||
|
||
const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html" | ||
|
||
add_task(function*() { | ||
let extraTab = gBrowser.selectedTab = gBrowser.addTab(); | ||
let tabLoaded = promiseTabLoaded(extraTab); | ||
extraTab.linkedBrowser.loadURI(TEST_URL); | ||
let expectedFavicon = "http://example.org/one-icon"; | ||
let haveChanged = new Promise.defer(); | ||
let observer = new MutationObserver(function(mutations) { | ||
for (let mut of mutations) { | ||
if (mut.attributeName != "image") { | ||
continue; | ||
} | ||
let imageVal = extraTab.getAttribute("image").replace(/#.*$/, ""); | ||
if (!imageVal) { | ||
// The value gets removed because it doesn't load. | ||
continue; | ||
} | ||
is(imageVal, expectedFavicon, "Favicon image should correspond to expected image."); | ||
haveChanged.resolve(); | ||
} | ||
}); | ||
observer.observe(extraTab, {attributes: true}); | ||
yield tabLoaded; | ||
expectedFavicon = "http://example.org/yet-another-icon"; | ||
haveChanged = new Promise.defer(); | ||
yield haveChanged.promise; | ||
observer.disconnect(); | ||
gBrowser.removeTab(extraTab); | ||
}); | ||
|
||
|
21 changes: 21 additions & 0 deletions
21
browser/base/content/test/general/file_favicon_change_not_in_document.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html><head> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | ||
<link rel="icon" href="http://example.org/one-icon" type="image/ico" id="i"> | ||
</head> | ||
<body onload="onload()"> | ||
<script> | ||
function onload() { | ||
var ico = document.createElement("link"); | ||
ico.setAttribute("rel", "icon"); | ||
ico.setAttribute("type", "image/ico"); | ||
ico.setAttribute("href", "http://example.org/other-icon"); | ||
setTimeout(function() { | ||
ico.setAttribute("href", "http://example.org/yet-another-icon"); | ||
document.getElementById("i").remove(); | ||
document.head.appendChild(ico); | ||
}, 1000); | ||
} | ||
</script> | ||
</body></html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.