forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 366324 - Make SVG favicons work reliably. r=mak
- Loading branch information
Showing
4 changed files
with
56 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const PAGEURI = NetUtil.newURI("http://deliciousbacon.com/"); | ||
|
||
add_task(function* () { | ||
// First, add a history entry or else Places can't save a favicon. | ||
yield PlacesTestUtils.addVisits({ | ||
uri: PAGEURI, | ||
transition: TRANSITION_LINK, | ||
visitDate: Date.now() * 1000 | ||
}); | ||
|
||
yield new Promise(resolve => { | ||
function onSetComplete(aURI, aDataLen, aData, aMimeType) { | ||
equal(aURI.spec, SMALLSVG_DATA_URI.spec, "setFavicon aURI check"); | ||
equal(aDataLen, 263, "setFavicon aDataLen check"); | ||
equal(aMimeType, "image/svg+xml", "setFavicon aMimeType check"); | ||
resolve(); | ||
} | ||
|
||
PlacesUtils.favicons.setAndFetchFaviconForPage(PAGEURI, SMALLSVG_DATA_URI, | ||
false, | ||
PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, | ||
onSetComplete); | ||
}); | ||
|
||
let data = yield PlacesUtils.promiseFaviconData(PAGEURI.spec); | ||
equal(data.uri.spec, SMALLSVG_DATA_URI.spec, "getFavicon aURI check"); | ||
equal(data.dataLen, 263, "getFavicon aDataLen check"); | ||
equal(data.mimeType, "image/svg+xml", "getFavicon aMimeType check"); | ||
}); | ||
|
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