diff options
Diffstat (limited to 'toolkit/components/places/tests/favicons/test_expire_on_new_icons.js')
-rw-r--r-- | toolkit/components/places/tests/favicons/test_expire_on_new_icons.js | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/toolkit/components/places/tests/favicons/test_expire_on_new_icons.js b/toolkit/components/places/tests/favicons/test_expire_on_new_icons.js index d5a7c42ba3..f0089d737b 100644 --- a/toolkit/components/places/tests/favicons/test_expire_on_new_icons.js +++ b/toolkit/components/places/tests/favicons/test_expire_on_new_icons.js @@ -28,23 +28,23 @@ add_task(async function test_expire_associated() { ]; for (let icon of favicons) { - let data = readFileData(do_get_file(icon.name)); - PlacesUtils.favicons.replaceFaviconData( - NetUtil.newURI(TEST_URL + icon.name), - data, + let dataURL = await readFileDataAsDataURL( + do_get_file(icon.name), icon.mimeType ); - await setFaviconForPage(TEST_URL, TEST_URL + icon.name); + await PlacesTestUtils.setFaviconForPage( + TEST_URL, + TEST_URL + icon.name, + dataURL + ); if (icon.expired) { await expireIconRelationsForPage(TEST_URL); // Add the same icon to another page. - PlacesUtils.favicons.replaceFaviconData( - NetUtil.newURI(TEST_URL + icon.name), - data, - icon.mimeType, - icon.expire + await PlacesTestUtils.setFaviconForPage( + TEST_URL2, + TEST_URL + icon.name, + dataURL ); - await setFaviconForPage(TEST_URL2, TEST_URL + icon.name); } } @@ -88,13 +88,7 @@ add_task(async function test_expire_root() { // Insert an expired icon. let iconURI = NetUtil.newURI(pageURI.spec + "favicon-normal16.png"); - PlacesUtils.favicons.replaceFaviconDataFromDataURL( - iconURI, - SMALLPNG_DATA_URI.spec, - 0, - systemPrincipal - ); - await setFaviconForPage(pageURI, iconURI); + await PlacesTestUtils.setFaviconForPage(pageURI, iconURI, SMALLPNG_DATA_URI); Assert.equal( await countEntries("moz_icons_to_pages"), 1, @@ -105,13 +99,11 @@ add_task(async function test_expire_root() { // Now insert a new root icon. let rootIconURI = NetUtil.newURI(pageURI.spec + "favicon.ico"); - PlacesUtils.favicons.replaceFaviconDataFromDataURL( + await PlacesTestUtils.setFaviconForPage( + pageURI, rootIconURI, - SMALLPNG_DATA_URI.spec, - 0, - systemPrincipal + SMALLPNG_DATA_URI ); - await setFaviconForPage(pageURI, rootIconURI); // Only the root icon should have survived. Assert.equal( |