mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Avoid an error in integration test because of a locale different of en-US
This commit is contained in:
parent
d95f680d66
commit
2b938c42f5
1 changed files with 16 additions and 0 deletions
|
@ -17,6 +17,22 @@ exports.loadAndWait = (filename, selector) =>
|
|||
Promise.all(
|
||||
global.integrationSessions.map(async session => {
|
||||
const page = await session.browser.newPage();
|
||||
|
||||
// In order to avoid errors because of checks which depend on
|
||||
// a locale.
|
||||
await page.evaluateOnNewDocument(() => {
|
||||
Object.defineProperty(navigator, "language", {
|
||||
get() {
|
||||
return "en-US";
|
||||
},
|
||||
});
|
||||
Object.defineProperty(navigator, "languages", {
|
||||
get() {
|
||||
return ["en-US", "en"];
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto(
|
||||
`${global.integrationBaseUrl}?file=/test/pdfs/${filename}`
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue