summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/reftests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /toolkit/content/tests/reftests
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/content/tests/reftests')
-rw-r--r--toolkit/content/tests/reftests/audio-dynamically-change-small-width-ref.html13
-rw-r--r--toolkit/content/tests/reftests/audio-dynamically-change-small-width.html32
-rw-r--r--toolkit/content/tests/reftests/audio-with-bogus-url-ref.html14
-rw-r--r--toolkit/content/tests/reftests/audio-with-bogus-url.html14
-rw-r--r--toolkit/content/tests/reftests/audio-with-padding-ref.html19
-rw-r--r--toolkit/content/tests/reftests/audio-with-padding.html17
-rw-r--r--toolkit/content/tests/reftests/foo.vtt4
-rw-r--r--toolkit/content/tests/reftests/reftest.list4
-rw-r--r--toolkit/content/tests/reftests/videocontrols-dynamically-add-cc-ref.html32
-rw-r--r--toolkit/content/tests/reftests/videocontrols-dynamically-add-cc.html61
10 files changed, 210 insertions, 0 deletions
diff --git a/toolkit/content/tests/reftests/audio-dynamically-change-small-width-ref.html b/toolkit/content/tests/reftests/audio-dynamically-change-small-width-ref.html
new file mode 100644
index 0000000000..4bcac35d84
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-dynamically-change-small-width-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio controls></audio>
+</body>
diff --git a/toolkit/content/tests/reftests/audio-dynamically-change-small-width.html b/toolkit/content/tests/reftests/audio-dynamically-change-small-width.html
new file mode 100644
index 0000000000..0e9059541a
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-dynamically-change-small-width.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio id="tweakme" controls></audio>
+
+ <script>
+ function doTest() {
+ setTimeout(() => {
+ let tweakme = document.getElementById("tweakme");
+
+ // Make the audio element extremely skinny, flush layout, and then revert
+ // that change:
+ tweakme.style.width = "1px";
+ tweakme.offsetHeight; // flush layout
+ tweakme.style.width = "";
+ tweakme.offsetHeight; // flush layout
+
+ document.documentElement.removeAttribute("class");
+ }, 300);
+ }
+
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+</body>
diff --git a/toolkit/content/tests/reftests/audio-with-bogus-url-ref.html b/toolkit/content/tests/reftests/audio-with-bogus-url-ref.html
new file mode 100644
index 0000000000..7731e5ced6
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-with-bogus-url-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio controls></audio>
+</body>
+</html>
diff --git a/toolkit/content/tests/reftests/audio-with-bogus-url.html b/toolkit/content/tests/reftests/audio-with-bogus-url.html
new file mode 100644
index 0000000000..d6bf7ff861
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-with-bogus-url.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio src="bogus.mp3" controls></audio>
+</body>
+</html>
diff --git a/toolkit/content/tests/reftests/audio-with-padding-ref.html b/toolkit/content/tests/reftests/audio-with-padding-ref.html
new file mode 100644
index 0000000000..b0fe3fa6e5
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-with-padding-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+
+ #wrapper {
+ padding: 20px;
+ }
+</style>
+</head>
+<body>
+ <div id="wrapper">
+ <audio controls></audio>
+ <div>
+</body>
diff --git a/toolkit/content/tests/reftests/audio-with-padding.html b/toolkit/content/tests/reftests/audio-with-padding.html
new file mode 100644
index 0000000000..c18b746374
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-with-padding.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+
+ audio {
+ padding: 20px;
+ }
+</style>
+</head>
+<body>
+ <audio controls></audio>
+</body>
diff --git a/toolkit/content/tests/reftests/foo.vtt b/toolkit/content/tests/reftests/foo.vtt
new file mode 100644
index 0000000000..b533895c60
--- /dev/null
+++ b/toolkit/content/tests/reftests/foo.vtt
@@ -0,0 +1,4 @@
+WEBVTT
+
+00:00:00.000 --> 00:00:05.000
+Foo
diff --git a/toolkit/content/tests/reftests/reftest.list b/toolkit/content/tests/reftests/reftest.list
new file mode 100644
index 0000000000..d1e8ce3dbd
--- /dev/null
+++ b/toolkit/content/tests/reftests/reftest.list
@@ -0,0 +1,4 @@
+== videocontrols-dynamically-add-cc.html videocontrols-dynamically-add-cc-ref.html
+== audio-with-bogus-url.html audio-with-bogus-url-ref.html
+== audio-dynamically-change-small-width.html audio-dynamically-change-small-width-ref.html
+== audio-with-padding.html audio-with-padding-ref.html
diff --git a/toolkit/content/tests/reftests/videocontrols-dynamically-add-cc-ref.html b/toolkit/content/tests/reftests/videocontrols-dynamically-add-cc-ref.html
new file mode 100644
index 0000000000..1dcf4949a6
--- /dev/null
+++ b/toolkit/content/tests/reftests/videocontrols-dynamically-add-cc-ref.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+
+ video {
+ width: 320px;
+ height: 240px;
+ }
+
+ #mask {
+ position: absolute;
+ z-index: 3;
+ width: 320px;
+ height: 200px;
+ background-color: green;
+ top: 0;
+ left: 0;
+ }
+</style>
+</head>
+<body>
+ <video id="vid" controls>
+ <track kind="subtitles" src="foo.vtt" srclang="en">
+ </video>
+ <div id="mask"></div>
+</body>
+</html>
diff --git a/toolkit/content/tests/reftests/videocontrols-dynamically-add-cc.html b/toolkit/content/tests/reftests/videocontrols-dynamically-add-cc.html
new file mode 100644
index 0000000000..e3d0912a51
--- /dev/null
+++ b/toolkit/content/tests/reftests/videocontrols-dynamically-add-cc.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+
+ video {
+ width: 320px;
+ height:240px;
+ }
+
+ #mask {
+ position: absolute;
+ z-index: 3;
+ width: 320px;
+ height: 200px;
+ background-color: green;
+ top: 0;
+ left: 0;
+ }
+
+ #vid-preload-image {
+ visibility: hidden;
+ }
+</style>
+<script>
+ function addCCToVid(videoElem) {
+ videoElem.addTextTrack("subtitles", "English", "en");
+ }
+</script>
+</head>
+<body>
+ <video id="vid" controls></video>
+ <div id="mask"></div>
+ <!-- Create a hidden video with CC button displayed upfront to decode image
+ earlier, so that the CC image will be ready to paint once the track added. -->
+ <video id="vid-preload-image" controls>
+ <track kind="subtitles" src="foo.vtt" srclang="en">
+ </video>
+
+ <script>
+ function doTest() {
+ var vid = document.getElementById("vid");
+
+ // Videocontrols binding's "addtrack" handler synchronously fires
+ // "adjustControlSize()" first, and then the layout is ready for
+ // the reftest snapshot.
+ vid.textTracks.addEventListener("addtrack", function() {
+ document.documentElement.removeAttribute("class");
+ });
+
+ addCCToVid(vid);
+ }
+
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+</body>
+</html>