From b51a5d17cee810046eed0b45bb2bae8be24f402e Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Mon, 4 Feb 2013 12:05:21 +0800 Subject: [PATCH] Bug 836624 - Remove getFaviconForPage and getFaviconDataAsDataURL in test_bookmarks_html.js. r=mak --- .../places/tests/unit/test_bookmarks_html.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html.js b/toolkit/components/places/tests/unit/test_bookmarks_html.js index 0f1b9052325c..a28983c48fbd 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_html.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_html.js @@ -336,12 +336,16 @@ function checkItem(aExpected, aNode) ); break; case "icon": - let faviconURI = PlacesUtils.favicons.getFaviconForPage( - NetUtil.newURI(aExpected.url) - ); - let dataURL = PlacesUtils.favicons.getFaviconDataAsDataURL(faviconURI); - // Avoid do_check_eq for console spam. - do_check_true(dataURL == aExpected.icon); + let deferred = Promise.defer(); + PlacesUtils.favicons.getFaviconDataForPage( + NetUtil.newURI(aExpected.url), + function (aURI, aDataLen, aData, aMimeType) { + let base64Icon = "data:image/png;base64," + + base64EncodeString(String.fromCharCode.apply(String, aData)); + do_check_true(base64Icon == aExpected.icon); + deferred.resolve(); + }); + return deferred.promise; break; case "keyword": break;