mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Restore window.alert after use in scripting test (#12987)
This commit is contained in:
parent
fc925827b2
commit
a8021208ea
1 changed files with 3 additions and 1 deletions
|
@ -18,7 +18,7 @@ import { loadScript } from "../../src/display/display_utils.js";
|
||||||
const sandboxBundleSrc = "../../build/generic/build/pdf.sandbox.js";
|
const sandboxBundleSrc = "../../build/generic/build/pdf.sandbox.js";
|
||||||
|
|
||||||
describe("Scripting", function () {
|
describe("Scripting", function () {
|
||||||
let sandbox, send_queue, test_id, ref;
|
let sandbox, send_queue, test_id, ref, windowAlert;
|
||||||
|
|
||||||
function getId() {
|
function getId() {
|
||||||
const id = `${ref++}R`;
|
const id = `${ref++}R`;
|
||||||
|
@ -48,6 +48,7 @@ describe("Scripting", function () {
|
||||||
send_queue.set(event.detail.id, event.detail);
|
send_queue.set(event.detail.id, event.detail);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
windowAlert = window.alert;
|
||||||
window.alert = value => {
|
window.alert = value => {
|
||||||
const command = "alert";
|
const command = "alert";
|
||||||
send_queue.set(command, { command, value });
|
send_queue.set(command, { command, value });
|
||||||
|
@ -76,6 +77,7 @@ describe("Scripting", function () {
|
||||||
sandbox.nukeSandbox();
|
sandbox.nukeSandbox();
|
||||||
sandbox = null;
|
sandbox = null;
|
||||||
send_queue = null;
|
send_queue = null;
|
||||||
|
window.alert = windowAlert;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Sandbox", function () {
|
describe("Sandbox", function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue