michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: const pageURI = michael@0: "http://example.org/tests/toolkit/components/places/tests/browser/favicon.html"; michael@0: let windowsToClose = []; michael@0: michael@0: registerCleanupFunction(function() { michael@0: windowsToClose.forEach(function(aWin) { michael@0: aWin.close(); michael@0: }); michael@0: }); michael@0: michael@0: function testOnWindow(aIsPrivate, aCallback) { michael@0: whenNewWindowLoaded({private: aIsPrivate}, function(aWin) { michael@0: windowsToClose.push(aWin); michael@0: executeSoon(function() aCallback(aWin)); michael@0: }); michael@0: }; michael@0: michael@0: function waitForTabLoad(aWin, aCallback) { michael@0: aWin.gBrowser.selectedBrowser.addEventListener("load", function onLoad() { michael@0: aWin.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true); michael@0: aCallback(); michael@0: }, true); michael@0: aWin.gBrowser.selectedBrowser.loadURI(pageURI); michael@0: } michael@0: michael@0: testOnWindow(true, function(win) { michael@0: waitForTabLoad(win, function() { michael@0: PlacesUtils.favicons.getFaviconURLForPage(NetUtil.newURI(pageURI), michael@0: function(uri, dataLen, data, mimeType) { michael@0: is(uri, null, "No result should be found"); michael@0: finish(); michael@0: } michael@0: ); michael@0: }); michael@0: }); michael@0: }