bug 1442980, add basic test for print previewed shadow DOM, r=bdahl

--HG--
extra : rebase_source : 66d28f5566710346022ef9a8f8d3459579edb546
This commit is contained in:
Olli Pettay 2018-05-04 11:56:04 +03:00
Родитель c8b02be077
Коммит 8b14d4d61a
2 изменённых файлов: 25 добавлений и 1 удалений

Просмотреть файл

@ -259,6 +259,28 @@ function runTest6end() {
printpreview();
exitprintpreview();
requestAnimationFrame(function() { setTimeout(runTest7); } );
}
function runTest7() {
var contentText = "<a href='#'>mozilla</a><input>test<select><option>option1</option></select>";
// Create normal content
window.frames[0].document.body.innerHTML =
"<div>" + contentText + "</div>";
window.frames[0].document.body.firstChild.value =
window.frames[0].document.body.firstChild.getAttribute('value');
printpreview();
ctx1.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(255,255,255)");
exitprintpreview();
window.frames[0].document.body.innerHTML = "<div></div>";
var sr = window.frames[0].document.body.firstChild.attachShadow({mode: "open"});
sr.innerHTML = contentText;
printpreview();
ctx2.drawWindow(window.frames[1], 0, 0, 400, 400, "rgb(255,255,255)");
exitprintpreview();
ok(compareCanvases(), "Printing light DOM and shadow DOM should create same output");
finish();
}

Просмотреть файл

@ -11,6 +11,8 @@
<script type="application/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();
window.open("printpreview_helper.xul", "printpreview", "chrome,width=100,height=100");
SpecialPowers.pushPrefEnv({"set":[["dom.webcomponents.shadowdom.enabled", true]]}, function() {
window.open("printpreview_helper.xul", "printpreview", "chrome,width=100,height=100");
});
]]></script>
</window>