diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/base/tests/chrome/chrome_content_integration_window.xhtml | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/base/tests/chrome/chrome_content_integration_window.xhtml')
-rw-r--r-- | layout/base/tests/chrome/chrome_content_integration_window.xhtml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/layout/base/tests/chrome/chrome_content_integration_window.xhtml b/layout/base/tests/chrome/chrome_content_integration_window.xhtml new file mode 100644 index 0000000000..4cc961b7d3 --- /dev/null +++ b/layout/base/tests/chrome/chrome_content_integration_window.xhtml @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/css" href="chrome://global/skin"?> +<window title="Content/chrome integration subwindow" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + onload="runTests()" + style="background:black; -moz-appearance:none;"> + <script src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script> + + <stack style="align-items: center; height: 300px; width: 200px;"> + <!-- the bottom 100px is a strip of black that should be vixible through the content iframe --> + <vbox style="background:pink; border-bottom:100px solid black"/> + <!-- the middle 100px is a strip of black in the content iframe --> + <!-- the bottom 100px of the iframe is transparent, the top 100px is yellow --> + <iframe type="content" style="border:none;" + transparent="transparent" + src="data:text/html,<div style='position:absolute;left:0;top:0;width:100%;height:100px;background:yellow;border-bottom:100px solid black'>"/> + <!-- the top 100px is a strip of black above the content iframe --> + <vbox style="border-top:100px solid black;"/> + </stack> + + <script type="application/javascript"> + <![CDATA[ + var imports = [ "SimpleTest", "is", "isnot", "ok", "SpecialPowers" ]; + for (var name of imports) { + window[name] = window.arguments[0][name]; + } + + function runTests() { + var testCanvas = snapshotWindow(window); + + var refCanvas = snapshotWindow(window); + var ctx = refCanvas.getContext('2d'); + ctx.fillStyle = "black"; + ctx.fillRect(0, 0, refCanvas.width, refCanvas.height); + + var comparison = compareSnapshots(testCanvas, refCanvas, true); + ok(comparison[0], "Rendering OK, got " + comparison[1] + ", expected " + comparison[2]); + + var tester = window.SimpleTest; + window.close(); + tester.finish(); + } + ]]> + </script> +</window> |