From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- browser/base/content/test/metaTags/head.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 browser/base/content/test/metaTags/head.js (limited to 'browser/base/content/test/metaTags/head.js') diff --git a/browser/base/content/test/metaTags/head.js b/browser/base/content/test/metaTags/head.js new file mode 100644 index 0000000000..1f292c4c03 --- /dev/null +++ b/browser/base/content/test/metaTags/head.js @@ -0,0 +1,19 @@ +ChromeUtils.defineESModuleGetters(this, { + PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", + PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", +}); + +/** + * Wait for url's page info (non-null description and preview url) to be set. + * Because there is debounce logic in ContentLinkHandler.jsm to only make one + * single SQL update, we have to wait for some time before checking that the page + * info was stored. + */ +async function waitForPageInfo(url) { + let pageInfo; + await BrowserTestUtils.waitForCondition(async () => { + pageInfo = await PlacesUtils.history.fetch(url, { includeMeta: true }); + return pageInfo && pageInfo.description && pageInfo.previewImageURL; + }); + return pageInfo; +} -- cgit v1.2.3