mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-04 01:01:00 +02:00
Merge pull request #21275 from timvandermeij/integration-tests-optimize
Optimize runtime and memory usage of the integration tests
This commit is contained in:
commit
2fb2bc13e0
@ -268,13 +268,8 @@ function getSelector(id) {
|
||||
}
|
||||
|
||||
async function getRect(page, selector) {
|
||||
// In Chrome something is wrong when serializing a `DomRect`,
|
||||
// so we extract the values and return them ourselves.
|
||||
await page.waitForSelector(selector, { visible: true });
|
||||
return page.$eval(selector, el => {
|
||||
const { x, y, width, height } = el.getBoundingClientRect();
|
||||
return { x, y, width, height };
|
||||
});
|
||||
return (await page.$(selector)).boundingBox();
|
||||
}
|
||||
|
||||
function getQuerySelector(id) {
|
||||
|
||||
@ -1403,6 +1403,10 @@ describe("PDF viewer", () => {
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("keeps the content under the pinch centre fixed on the screen", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
@ -1610,6 +1614,10 @@ describe("PDF viewer", () => {
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("Check that the top right corner of the annotation is centered vertically", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
|
||||
@ -992,7 +992,7 @@ async function startBrowser({
|
||||
// calls can run before events triggered by the previous protocol calls had
|
||||
// a chance to be processed (essentially causing events to get lost). This
|
||||
// value gives Chrome a more similar execution speed as Firefox.
|
||||
options.slowMo = 5;
|
||||
options.slowMo = 3;
|
||||
|
||||
// avoid crash
|
||||
options.args = ["--no-sandbox", "--disable-setuid-sandbox"];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user