summaryrefslogtreecommitdiffstats
path: root/taskcluster/docker
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /taskcluster/docker
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/docker')
-rw-r--r--taskcluster/docker/funsize-update-generator/scripts/funsize.py17
-rw-r--r--taskcluster/docker/periodic-updates/.eslintrc.js9
-rwxr-xr-xtaskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh4
-rwxr-xr-xtaskcluster/docker/snap-coreXX-build/run.sh45
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests.py138
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests/expectations.json.in4
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests.py110
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_custom_fonts_ref.pngbin51060 -> 50872 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_download_base.pngbin127756 -> 122847 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_base.pngbin167492 -> 193331 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_documentProperties.pngbin177679 -> 176165 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_down.pngbin242142 -> 240082 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_end.pngbin135099 -> 132913 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_firstPage.pngbin194764 -> 193331 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_hand_tool.pngbin197844 -> 193380 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_home.pngbin194764 -> 193331 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_lastPage.pngbin135099 -> 132913 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_left.pngbin194878 -> 193449 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_next.pngbin247191 -> 244744 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCcw.pngbin194810 -> 193331 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCw.pngbin276055 -> 271951 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pagedown.pngbin216369 -> 219231 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageup.pngbin171383 -> 166969 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_previous.pngbin224991 -> 222616 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_right.pngbin247234 -> 244899 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_select_text.pngbin195176 -> 193731 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_up.pngbin224891 -> 222616 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_100p.pngbin194764 -> 193331 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_150p.pngbin166658 -> 163176 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_400p.pngbin72156 -> 68023 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_50p.pngbin150887 -> 149198 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_75p.pngbin155313 -> 151437 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_actual.pngbin195201 -> 193331 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_fit.pngbin162736 -> 158687 bytes
-rw-r--r--taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_width.pngbin188823 -> 186025 bytes
35 files changed, 255 insertions, 72 deletions
diff --git a/taskcluster/docker/funsize-update-generator/scripts/funsize.py b/taskcluster/docker/funsize-update-generator/scripts/funsize.py
index 84fd2fbd0b..0e72da46fc 100644
--- a/taskcluster/docker/funsize-update-generator/scripts/funsize.py
+++ b/taskcluster/docker/funsize-update-generator/scripts/funsize.py
@@ -13,7 +13,6 @@ import shutil
import tempfile
import time
from contextlib import AsyncExitStack
-from distutils.util import strtobool
from pathlib import Path
import aiohttp
@@ -51,6 +50,22 @@ BCJ_OPTIONS = {
}
+def strtobool(value: str):
+ # Copied from `mach.util` since this script runs outside of a mach environment
+ # Reimplementation of distutils.util.strtobool
+ # https://docs.python.org/3.9/distutils/apiref.html#distutils.util.strtobool
+ true_vals = ("y", "yes", "t", "true", "on", "1")
+ false_vals = ("n", "no", "f", "false", "off", "0")
+
+ value = value.lower()
+ if value in true_vals:
+ return 1
+ if value in false_vals:
+ return 0
+
+ raise ValueError(f'Expected one of: {", ".join(true_vals + false_vals)}')
+
+
def verify_signature(mar, cert):
log.info("Checking %s signature", mar)
with open(mar, "rb") as mar_fh:
diff --git a/taskcluster/docker/periodic-updates/.eslintrc.js b/taskcluster/docker/periodic-updates/.eslintrc.js
index ecaf80d033..508b1cfbce 100644
--- a/taskcluster/docker/periodic-updates/.eslintrc.js
+++ b/taskcluster/docker/periodic-updates/.eslintrc.js
@@ -14,9 +14,6 @@ module.exports = {
// Enforce return statements in callbacks of array methods.
"array-callback-return": "error",
- // Verify calls of super() in constructors.
- "constructor-super": "error",
-
// Require default case in switch statements.
"default-case": "error",
@@ -27,9 +24,6 @@ module.exports = {
// case/default clauses.
"no-case-declarations": "error",
- // Disallow use of the console API.
- "no-console": "error",
-
// Disallow constant expressions in conditions (except for loops).
"no-constant-condition": ["error", { checkLoops: false }],
@@ -48,9 +42,6 @@ module.exports = {
// No expressions where a statement is expected
"no-unused-expressions": "error",
- // Disallow unnecessary escape usage in strings and regular expressions.
- "no-useless-escape": "error",
-
// Require "use strict" to be defined globally in the script.
strict: ["error", "global"],
diff --git a/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh b/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
index c5b9c78f6f..f01f5cd9c3 100755
--- a/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
+++ b/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
@@ -322,7 +322,7 @@ function compare_remote_settings_files {
# 5. Download attachments if needed.
if [ "${bucket}" = "blocklists" ] && [ "${collection}" = "addons-bloomfilters" ]; then
- # Find the attachment with the most recent generation_time, like _updateMLBF in Blocklist.jsm.
+ # Find the attachment with the most recent generation_time, like _updateMLBF in Blocklist.sys.mjs.
# The server should return one "bloomfilter-base" record, but in case it returns multiple,
# return the most recent one. The server may send multiple entries if we ever decide to use
# the "filter_expression" feature of Remote Settings to send different records to specific
@@ -364,7 +364,7 @@ function update_remote_settings_attachment() {
# $4 is a jq filter on the arrays that should return one record with the attachment
local jq_attachment_selector=".data | map(select(.attachment)) | $4"
- # These paths match _readAttachmentDump in services/settings/Attachments.jsm.
+ # These paths match _readAttachmentDump in services/settings/Attachments.sys.mjs.
local path_to_attachment="${bucket}/${collection}/${attachment_id}"
local path_to_meta="${bucket}/${collection}/${attachment_id}.meta.json"
local old_meta="$REMOTE_SETTINGS_INPUT/${path_to_meta}"
diff --git a/taskcluster/docker/snap-coreXX-build/run.sh b/taskcluster/docker/snap-coreXX-build/run.sh
index 5b3efbb756..234fc98519 100755
--- a/taskcluster/docker/snap-coreXX-build/run.sh
+++ b/taskcluster/docker/snap-coreXX-build/run.sh
@@ -19,7 +19,7 @@ unset MOZ_AUTOMATION
MOZCONFIG=mozconfig.in
-USE_SNAP_FROM_STORE=${USE_SNAP_FROM_STORE:-0}
+USE_SNAP_FROM_STORE_OR_MC=${USE_SNAP_FROM_STORE_OR_MC:-0}
TRY=0
if [ "${BRANCH}" = "try" ]; then
@@ -27,7 +27,7 @@ if [ "${BRANCH}" = "try" ]; then
TRY=1
fi
-if [ "${USE_SNAP_FROM_STORE}" = "0" ]; then
+if [ "${USE_SNAP_FROM_STORE_OR_MC}" = "0" ]; then
# ESR currently still has a hard dependency against zstandard==0.17.0 so
# install this specific version here
if [ "${BRANCH}" = "esr" ]; then
@@ -91,7 +91,7 @@ if [ "${USE_SNAP_FROM_STORE}" = "0" ]; then
SNAPCRAFT_BUILD_ENVIRONMENT_CPU=$(nproc) \
CRAFT_PARTS_PACKAGE_REFRESH=0 \
snapcraft --destructive-mode --verbose
-else
+elif [ "${USE_SNAP_FROM_STORE_OR_MC}" = "store" ]; then
mkdir from-snap-store && cd from-snap-store
CHANNEL="${BRANCH}"
@@ -102,6 +102,45 @@ else
snap download --channel="${CHANNEL}" firefox
SNAP_DEBUG_NAME=$(find . -maxdepth 1 -type f -name "firefox*.snap" | sed -e 's/\.snap$/.debug/g')
touch "${SNAP_DEBUG_NAME}"
+else
+ mkdir from-mc && cd from-mc
+
+ # index.gecko.v2.mozilla-central.latest.firefox.amd64-esr-debug
+ # => https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.latest.firefox.amd64-esr-debug/artifacts/public%2Fbuild%2Ffirefox.snap
+ # index.gecko.v2.mozilla-central.revision.bf0897ec442e625c185407cc615a6adc0e40fa75.firefox.amd64-esr-debug
+ # => https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.revision.bf0897ec442e625c185407cc615a6adc0e40fa75.firefox.amd64-esr-debug/artifacts/public%2Fbuild%2Ffirefox.snap
+ # index.gecko.v2.mozilla-central.latest.firefox.amd64-nightly
+ # => https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.latest.firefox.amd64-nightly/artifacts/public%2Fbuild%2Ffirefox.snap
+ # index.gecko.v2.mozilla-central.revision.bf0897ec442e625c185407cc615a6adc0e40fa75.firefox.amd64-nightly
+ # => https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.revision.bf0897ec442e625c185407cc615a6adc0e40fa75.firefox.amd64-nightly/artifacts/public%2Fbuild%2Ffirefox.snap
+
+ INDEX_NAME="${BRANCH}"
+ if [ "${INDEX_NAME}" = "try" ]; then
+ INDEX_NAME=nightly
+ fi;
+
+ if [ "${DEBUG}" = "1" ]; then
+ INDEX_NAME="${INDEX_NAME}-debug"
+ fi;
+
+ TASKCLUSTER_API_ROOT="https://firefox-ci-tc.services.mozilla.com/api"
+
+ URL_TASK="${TASKCLUSTER_API_ROOT}/index/v1/task/gecko.v2.mozilla-central.${USE_SNAP_FROM_STORE_OR_MC}.firefox.amd64-${INDEX_NAME}"
+ PKGS_TASK_ID=$(curl "${URL_TASK}" | jq -r '.taskId')
+
+ if [ -z "${PKGS_TASK_ID}" ]; then
+ echo "Failure to find matching taskId for ${USE_SNAP_FROM_STORE_OR_MC} + ${INDEX_NAME}"
+ exit 1
+ fi
+
+ PKGS_URL="${TASKCLUSTER_API_ROOT}/queue/v1/task/${PKGS_TASK_ID}/artifacts"
+ for pkg in $(curl "${PKGS_URL}" | jq -r '.artifacts | . [] | select(.name | contains("public/build/firefox_")) | .name');
+ do
+ url="${TASKCLUSTER_API_ROOT}/queue/v1/task/${PKGS_TASK_ID}/artifacts/${pkg}"
+ target_name="$(basename "${pkg}")"
+ echo "$url => $target_name"
+ curl -SL "${url}" -o "${target_name}"
+ done;
fi
cp ./*.snap ./*.debug /builds/worker/artifacts/
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests.py b/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests.py
index fb8841817b..87320d5638 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests.py
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests.py
@@ -13,12 +13,13 @@ import time
import traceback
from mozlog import formatters, handlers, structuredlog
-from PIL import Image, ImageChops
+from PIL import Image, ImageChops, ImageDraw
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service
+from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
@@ -128,6 +129,9 @@ class SnapTestsBase:
else:
return 5
+ def is_debug_build(self):
+ return "BUILD_IS_DEBUG" in os.environ.keys()
+
def maybe_collect_reference(self):
return "TEST_COLLECT_REFERENCE" in os.environ.keys()
@@ -149,9 +153,11 @@ class SnapTestsBase:
element_or_driver.screenshot_as_png
if isinstance(element_or_driver, WebElement)
else element_or_driver.get_screenshot_as_png()
+ if isinstance(element_or_driver, WebDriver)
+ else base64.b64decode(element_or_driver)
)
svg_png = Image.open(io.BytesIO(png_bytes)).convert("RGB")
- svg_png_cropped = svg_png.crop((0, 0, svg_png.width - 20, svg_png.height - 20))
+ svg_png_cropped = svg_png.crop((0, 35, svg_png.width - 20, svg_png.height - 10))
if self.maybe_collect_reference():
new_ref = "new_{}".format(exp["reference"])
@@ -169,8 +175,28 @@ class SnapTestsBase:
svg_ref = Image.open(os.path.join(self._dir, exp["reference"])).convert("RGB")
diff = ImageChops.difference(svg_ref, svg_png_cropped)
+ bbox = diff.getbbox()
+
+ if bbox is not None:
+ (diff_r, diff_g, diff_b) = diff.getextrema()
+
+ min_is_black = (diff_r[0] == 0) and (diff_g[0] == 0) and (diff_b[0] == 0)
+ max_is_low_enough = (
+ (diff_r[1] <= 15) and (diff_g[1] <= 15) and (diff_b[1] <= 15)
+ )
+
+ draw_ref = ImageDraw.Draw(svg_ref)
+ draw_ref.rectangle(bbox, outline="red")
+
+ draw_rend = ImageDraw.Draw(svg_png_cropped)
+ draw_rend.rectangle(bbox, outline="red")
+
+ draw_diff = ImageDraw.Draw(diff)
+ draw_diff.rectangle(bbox, outline="red")
+
+ # Some differences have been found, let's verify
+ self._logger.info("Non empty differences bbox: {}".format(bbox))
- if diff.getbbox() is not None:
buffered = io.BytesIO()
diff.save(buffered, format="PNG")
@@ -190,8 +216,18 @@ class SnapTestsBase:
) as current_screenshot:
svg_png_cropped.save(current_screenshot)
- assert diff.getbbox() is None, "Mismatching screenshots for {}".format(
- exp["reference"]
+ with open(
+ self.get_screenshot_destination("reference_rendering.png"), "wb"
+ ) as current_screenshot:
+ svg_ref.save(current_screenshot)
+
+ # Assume a difference is mismatching if the minimum pixel value in
+ # image difference is NOT black or if the maximum pixel value is
+ # not low enough
+ assert (
+ min_is_black and max_is_low_enough
+ ), "Mismatching screenshots for {} with extremas: {}".format(
+ exp["reference"], (diff_r, diff_g, diff_b)
)
@@ -255,7 +291,7 @@ class SnapTests(SnapTestsBase):
return True
def test_youtube(self, exp):
- self.open_tab("https://www.youtube.com")
+ self.open_tab("https://www.youtube.com/channel/UCYfdidRxbB8Qhf0Nx7ioOYw")
# Wait for the consent dialog and accept it
self._logger.info("Wait for consent form")
@@ -268,25 +304,86 @@ class SnapTests(SnapTestsBase):
except TimeoutException:
self._logger.info("Wait for consent form: timed out, maybe it is not here")
- try:
- # Find first video and click it
- self._logger.info("Wait for one video")
+ # Find first video and click it
+ self._logger.info("Wait for one video")
+ self._wait.until(
+ EC.visibility_of_element_located((By.ID, "video-title-link"))
+ ).click()
+
+ # Wait for duration to be set to something
+ self._logger.info("Wait for video to start")
+ video = self._wait.until(
+ EC.visibility_of_element_located((By.CLASS_NAME, "html5-main-video"))
+ )
+ self._wait.until(lambda d: type(video.get_property("duration")) == float)
+ self._logger.info("video duration: {}".format(video.get_property("duration")))
+ assert (
+ video.get_property("duration") > exp["duration"]
+ ), "youtube video should have duration"
+
+ self._wait.until(lambda d: video.get_property("currentTime") > exp["playback"])
+ self._logger.info("video played: {}".format(video.get_property("currentTime")))
+ assert (
+ video.get_property("currentTime") > exp["playback"]
+ ), "youtube video should perform playback"
+
+ return True
+
+ def wait_for_enable_drm(self):
+ rv = True
+ self._driver.set_context("chrome")
+ self._driver.execute_script(
+ "Services.prefs.setBoolPref('media.gmp-manager.updateEnabled', true);"
+ )
+
+ channel = self._driver.execute_script(
+ "return Services.prefs.getCharPref('app.update.channel');"
+ )
+ if channel == "esr":
+ rv = False
+ else:
+ enable_drm_button = self._wait.until(
+ EC.visibility_of_element_located(
+ (By.CSS_SELECTOR, ".notification-button[label='Enable DRM']")
+ )
+ )
+ self._logger.info("Enabling DRMs")
+ enable_drm_button.click()
self._wait.until(
- EC.visibility_of_element_located((By.ID, "video-title-link"))
- ).click()
- except TimeoutException:
- # We might have got the "try searching to get started"
- # link to News channel
- self._driver.get("https://www.youtube.com/channel/UCYfdidRxbB8Qhf0Nx7ioOYw")
- self._logger.info("Wait again for one video")
+ EC.invisibility_of_element_located(
+ (By.CSS_SELECTOR, ".notification-button[label='Enable DRM']")
+ )
+ )
+
+ self._logger.info("Installing DRMs")
self._wait.until(
- EC.visibility_of_element_located((By.ID, "video-title-link"))
- ).click()
+ EC.visibility_of_element_located(
+ (By.CSS_SELECTOR, ".infobar[value='drmContentCDMInstalling']")
+ )
+ )
+
+ self._logger.info("Waiting for DRMs installation to complete")
+ self._longwait.until(
+ EC.invisibility_of_element_located(
+ (By.CSS_SELECTOR, ".infobar[value='drmContentCDMInstalling']")
+ )
+ )
+
+ self._driver.set_context("content")
+ return rv
+
+ def test_youtube_film(self, exp):
+ self.open_tab("https://www.youtube.com/watch?v=i4FSx9LXVSE")
+ if not self.wait_for_enable_drm():
+ self._logger.info("Skipped on ESR because cannot enable DRM")
+ return True
# Wait for duration to be set to something
self._logger.info("Wait for video to start")
video = self._wait.until(
- EC.visibility_of_element_located((By.CLASS_NAME, "html5-main-video"))
+ EC.visibility_of_element_located(
+ (By.CSS_SELECTOR, "video.html5-main-video")
+ )
)
self._wait.until(lambda d: type(video.get_property("duration")) == float)
self._logger.info("video duration: {}".format(video.get_property("duration")))
@@ -294,6 +391,9 @@ class SnapTests(SnapTestsBase):
video.get_property("duration") > exp["duration"]
), "youtube video should have duration"
+ self._driver.execute_script("arguments[0].click();", video)
+ video.send_keys("k")
+
self._wait.until(lambda d: video.get_property("currentTime") > exp["playback"])
self._logger.info("video played: {}".format(video.get_property("currentTime")))
assert (
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests/expectations.json.in b/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests/expectations.json.in
index 92e26dd699..32cb20c88c 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests/expectations.json.in
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/basic_tests/expectations.json.in
@@ -10,5 +10,9 @@
"test_youtube": {
"duration": 1,
"playback": 2
+ },
+ "test_youtube_film": {
+ "duration": 1,
+ "playback": 2
}
}
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests.py b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests.py
index 781000981e..7788dabe34 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests.py
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests.py
@@ -10,7 +10,7 @@ import tempfile
import time
from basic_tests import SnapTestsBase
-from selenium.common.exceptions import StaleElementReferenceException, TimeoutException
+from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
@@ -35,7 +35,9 @@ class QATests(SnapTestsBase):
if iframe_selector:
self._logger.info("find iframe")
- iframe = self._driver.find_element(By.CSS_SELECTOR, iframe_selector)
+ iframe = self._wait.until(
+ EC.visibility_of_element_located((By.CSS_SELECTOR, iframe_selector))
+ )
self._driver.switch_to.frame(iframe)
self._logger.info("find video")
@@ -259,6 +261,15 @@ class QATests(SnapTestsBase):
self._wait.until(lambda d: pdf_div.is_displayed() is True)
return pdf_div
+ def is_esr(self):
+ self._driver.set_context("chrome")
+ update_channel = self._driver.execute_script(
+ "return Services.prefs.getStringPref('app.update.channel');"
+ )
+ self._logger.info("Update channel: {}".format(update_channel))
+ self._driver.set_context("content")
+ return update_channel == "esr"
+
def pdf_get_page(self, page, long=False):
waiter = self._longwait if long is True else self._wait
page = waiter.until(
@@ -267,22 +278,26 @@ class QATests(SnapTestsBase):
)
)
- try:
- self._wait.until(lambda d: page.is_displayed() is True)
- except StaleElementReferenceException as ex:
- self._logger.info("Stale element but who cares?: {}".format(ex))
- time.sleep(2)
-
- # self._wait.until(
- # lambda d: d.execute_script(
- # 'return window.getComputedStyle(document.querySelector(".loadingInput.start"), "::after").getPropertyValue("visibility");'
- # )
- # == "hidden"
- # )
-
- # PDF.js can take time to settle and we don't have a nice way to wait
- # for an event on it
- time.sleep(2)
+ if not self.is_esr():
+ self._wait.until(
+ lambda d: d.execute_script(
+ 'return window.getComputedStyle(document.querySelector(".loadingInput.start"), "::after").getPropertyValue("visibility");'
+ )
+ != "visible"
+ )
+ # PDF.js can take time to settle and we don't have a nice way to wait
+ # for an event on it
+ time.sleep(1)
+ else:
+ self._logger.info("Running against ESR, just wait too much.")
+ # Big but let's be safe, this is only for ESR because its PDF.js
+ # does not have "<span class='loadingInput start'>"
+ time.sleep(10)
+
+ # Rendering can be slower on debug build so give more time to settle
+ if self.is_debug_build():
+ time.sleep(3)
+
return page
def pdf_go_to_page(self, page):
@@ -302,8 +317,8 @@ class QATests(SnapTestsBase):
# Test basic rendering
self.pdf_wait_div()
self.pdf_select_zoom("1")
- page_1 = self.pdf_get_page(1)
- self.assert_rendering(exp["base"], page_1)
+ self.pdf_get_page(1)
+ self.assert_rendering(exp["base"], self._driver)
# Navigating to page X, we know the PDF has 5 pages.
rand_page = random.randint(1, 5)
@@ -396,10 +411,37 @@ class QATests(SnapTestsBase):
if menu_id == "pageRotateCw" or menu_id == "pageRotateCcw":
secondary_menu.click()
- time.sleep(0.2)
+ time.sleep(0.75)
self._logger.info("assert {}".format(menu_id))
- self.assert_rendering(exp[menu_id], self._driver)
+ if self.is_esr() and menu_id == "documentProperties":
+ # on ESR pdf.js misreports in mm instead of inches
+ title = self._wait.until(
+ EC.visibility_of_element_located((By.ID, "titleField"))
+ )
+ author = self._wait.until(
+ EC.visibility_of_element_located((By.ID, "authorField"))
+ )
+ subject = self._wait.until(
+ EC.visibility_of_element_located((By.ID, "subjectField"))
+ )
+ version = self._wait.until(
+ EC.visibility_of_element_located((By.ID, "versionField"))
+ )
+ assert title.text == "PDF", "Incorrect PDF title reported: {}".format(
+ title
+ )
+ assert (
+ author.text == "Software 995"
+ ), "Incorrect PDF author reported: {}".format(author)
+ assert (
+ subject.text == "Create PDF with Pdf 995"
+ ), "Incorrect PDF subject reported: {}".format(subject)
+ assert (
+ version.text == "1.3"
+ ), "Incorrect PDF version reported: {}".format(version)
+ else:
+ self.assert_rendering(exp[menu_id], self._driver)
if menu_id == "documentProperties":
close = self._wait.until(
@@ -423,6 +465,7 @@ class QATests(SnapTestsBase):
)
)
action.drag_and_drop_by_offset(paragraph, 50, 10).perform()
+ time.sleep(0.75)
self.assert_rendering(exp["select_text"], self._driver)
# release select selection
@@ -464,7 +507,7 @@ class QATests(SnapTestsBase):
for zoom, page, ref in zoom_levels:
self.pdf_select_zoom(zoom)
- self.pdf_get_page(page)
+ self.pdf_get_page(page, long=True)
self._logger.info("assert {}".format(ref))
self.assert_rendering(exp[ref], self._driver)
@@ -704,17 +747,8 @@ class QATests(SnapTestsBase):
download_dir_pref == new
), "download directory from pref should match new directory"
- def open_thinkbroadband(self):
- download_site = self.open_tab("https://www.thinkbroadband.com/download")
- try:
- consent = self._wait.until(
- EC.visibility_of_element_located(
- (By.CSS_SELECTOR, ".t-acceptAllButton")
- )
- )
- consent.click()
- except TimeoutException:
- self._logger.info("Wait for consent form: timed out, maybe it is not here")
+ def open_lafibre(self):
+ download_site = self.open_tab("https://ip.lafibre.info/test-debit.php")
return download_site
def test_download_folder_change(self, exp):
@@ -722,12 +756,12 @@ class QATests(SnapTestsBase):
C1756713
"""
- download_site = self.open_thinkbroadband()
+ download_site = self.open_lafibre()
extra_small = self._wait.until(
EC.presence_of_element_located(
(
By.CSS_SELECTOR,
- "div.module:nth-child(8) > p:nth-child(1) > a:nth-child(1)",
+ ".tableau > tbody:nth-child(1) > tr:nth-child(6) > td:nth-child(2) > a:nth-child(1)",
)
)
)
@@ -775,12 +809,12 @@ class QATests(SnapTestsBase):
C1756715
"""
- download_site = self.open_thinkbroadband()
+ download_site = self.open_lafibre()
extra_small = self._wait.until(
EC.presence_of_element_located(
(
By.CSS_SELECTOR,
- "div.module:nth-child(8) > p:nth-child(1) > a:nth-child(1)",
+ ".tableau > tbody:nth-child(1) > tr:nth-child(6) > td:nth-child(2) > a:nth-child(1)",
)
)
)
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_custom_fonts_ref.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_custom_fonts_ref.png
index 02263329e2..03a4cfeb3d 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_custom_fonts_ref.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_custom_fonts_ref.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_download_base.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_download_base.png
index 98bf604c4b..da5824e130 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_download_base.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_download_base.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_base.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_base.png
index 71046ad3c3..99e2deee95 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_base.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_base.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_documentProperties.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_documentProperties.png
index 6eeeb95f2b..f0f4ea15f5 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_documentProperties.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_documentProperties.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_down.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_down.png
index c3818c9726..84fcdd160d 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_down.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_down.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_end.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_end.png
index 86bf1f158d..bd18d5e083 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_end.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_end.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_firstPage.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_firstPage.png
index 1b33d8374e..99e2deee95 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_firstPage.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_firstPage.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_hand_tool.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_hand_tool.png
index d84c9158d9..368dbab60b 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_hand_tool.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_hand_tool.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_home.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_home.png
index 1b33d8374e..99e2deee95 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_home.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_home.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_lastPage.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_lastPage.png
index 86bf1f158d..bd18d5e083 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_lastPage.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_lastPage.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_left.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_left.png
index aa36bda00c..6375855c02 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_left.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_left.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_next.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_next.png
index 21e930607c..c43825e7be 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_next.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_next.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCcw.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCcw.png
index 19062697d9..99e2deee95 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCcw.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCcw.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCw.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCw.png
index 176ab1dcff..484df8e2f0 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCw.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageRotateCw.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pagedown.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pagedown.png
index db05b7feb2..6523031e0e 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pagedown.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pagedown.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageup.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageup.png
index 8df2181704..628bd1d25f 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageup.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_pageup.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_previous.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_previous.png
index 19c727c5e0..f017be89ba 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_previous.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_previous.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_right.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_right.png
index be6d48cc30..22e4d3a33d 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_right.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_right.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_select_text.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_select_text.png
index 95fa211e1b..0e24a1ac74 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_select_text.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_select_text.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_up.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_up.png
index cd5067574c..f017be89ba 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_up.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_navigation_up.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_100p.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_100p.png
index 1b33d8374e..99e2deee95 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_100p.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_100p.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_150p.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_150p.png
index add7d3a9bb..30602dc1ee 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_150p.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_150p.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_400p.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_400p.png
index 58f832c3e5..3ebd4191fd 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_400p.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_400p.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_50p.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_50p.png
index 310bb889be..f860c9d640 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_50p.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_50p.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_75p.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_75p.png
index 5a21ade0c0..fd136334d2 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_75p.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_75p.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_actual.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_actual.png
index d047a4fcbf..99e2deee95 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_actual.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_actual.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_fit.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_fit.png
index b721fd3296..4e1dc3066a 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_fit.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_fit.png
Binary files differ
diff --git a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_width.png b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_width.png
index 061eafda7f..c77f23edbd 100644
--- a/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_width.png
+++ b/taskcluster/docker/snap-coreXX-build/snap-tests/qa_tests/test_pdf_zoom_p1_width.png
Binary files differ