mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #15782 from calixteman/15780
[api-minor][Editor] Don't use the editor parent which can be null.
This commit is contained in:
commit
fe3df4dcb4
9 changed files with 270 additions and 126 deletions
|
@ -599,6 +599,49 @@ describe("Editor", () => {
|
|||
[0, 0, 0],
|
||||
[0, 0, 0],
|
||||
]);
|
||||
|
||||
// Increase the font size for all the annotations.
|
||||
// Select all.
|
||||
await page.keyboard.down("Control");
|
||||
await page.keyboard.press("a");
|
||||
await page.keyboard.up("Control");
|
||||
await page.waitForTimeout(10);
|
||||
|
||||
page.evaluate(() => {
|
||||
window.PDFViewerApplication.eventBus.dispatch(
|
||||
"switchannotationeditorparams",
|
||||
{
|
||||
source: null,
|
||||
type: /* AnnotationEditorParamsType.FREETEXT_SIZE */ 1,
|
||||
value: 13,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
await page.waitForTimeout(10);
|
||||
expect(await serialize("fontSize"))
|
||||
.withContext(`In ${browserName}`)
|
||||
.toEqual([13, 13]);
|
||||
|
||||
// Change the colors for all the annotations.
|
||||
page.evaluate(() => {
|
||||
window.PDFViewerApplication.eventBus.dispatch(
|
||||
"switchannotationeditorparams",
|
||||
{
|
||||
source: null,
|
||||
type: /* AnnotationEditorParamsType.FREETEXT_COLOR */ 2,
|
||||
value: "#FF0000",
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
await page.waitForTimeout(10);
|
||||
expect(await serialize("color"))
|
||||
.withContext(`In ${browserName}`)
|
||||
.toEqual([
|
||||
[255, 0, 0],
|
||||
[255, 0, 0],
|
||||
]);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue