Backed out changeset 4079bc8d46ca (bug 1719124) for causing failures on printcmd.py. CLOSED TREE

This commit is contained in:
Marian-Vasile Laza 2021-08-06 19:31:56 +03:00
Родитель 9c94fc9c4c
Коммит d8ab847244
2 изменённых файлов: 2 добавлений и 57 удалений

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

@ -2912,20 +2912,9 @@ GeckoDriver.prototype.print = async function(cmd) {
}
// Each UCS2 character has an upper byte of 0 and a lower byte matching
// the binary data. Splitting the file into chunks to avoid hitting the
// internal argument length limit.
const chunks = [];
// This is the largest power of 2 smaller than MAX_ARGS_LENGTH defined in Spidermonkey
const argLengthLimit = 262144;
for (let offset = 0; offset < bytes.length; offset += argLengthLimit) {
const chunkData = bytes.subarray(offset, offset + argLengthLimit);
chunks.push(String.fromCharCode.apply(null, chunkData));
}
// the binary data
return {
value: btoa(chunks.join("")),
value: btoa(String.fromCharCode.apply(null, bytes)),
};
};

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

@ -41,50 +41,6 @@ def test_html_document(session, inline):
# TODO: Test that the output is reasonable
assert_pdf(pdf)
def test_large_html_document(session, inline):
session.url = inline("<div id=\"root\"></div>")
session.execute_script(
"""
const root = document.getElementById("root");
const width = 400;
const height = 600;
const rects = [];
for (let x = 0; x < width; ++x) {
for (let y = 0; y < height; ++y) {
const colourHex = Math.floor(Math.random() * 0xffffff).toString(16);
rects.push(`<rect x="${x}" y="${y}" width="1" height="1" fill="#${colourHex}" />`);
}
}
const svg = `
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 ${width} ${height}"
width="${width}"
height="${height}"
>
${rects.join("")}
</svg>
`;
root.insertAdjacentHTML("beforeend", svg);
"""
)
response = do_print(session, {})
value = assert_success(response)
pdf = decodebytes(value.encode())
# This was added to test the fix for a bug in firefox where a PDF larger
# than 500kb would cause an error. If the resulting PDF is smaller than that
# it could pass incorrectly.
assert len(pdf) > 500000
assert_pdf(pdf)
@pytest.mark.parametrize("options", [{"orientation": 0},
{"orientation": "foo"},