Skip to content

Commit a802120

Browse files
authored
Restore window.alert after use in scripting test (#12987)
1 parent fc92582 commit a802120

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/unit/scripting_spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { loadScript } from "../../src/display/display_utils.js";
1818
const sandboxBundleSrc = "../../build/generic/build/pdf.sandbox.js";
1919

2020
describe("Scripting", function () {
21-
let sandbox, send_queue, test_id, ref;
21+
let sandbox, send_queue, test_id, ref, windowAlert;
2222

2323
function getId() {
2424
const id = `${ref++}R`;
@@ -48,6 +48,7 @@ describe("Scripting", function () {
4848
send_queue.set(event.detail.id, event.detail);
4949
}
5050
};
51+
windowAlert = window.alert;
5152
window.alert = value => {
5253
const command = "alert";
5354
send_queue.set(command, { command, value });
@@ -76,6 +77,7 @@ describe("Scripting", function () {
7677
sandbox.nukeSandbox();
7778
sandbox = null;
7879
send_queue = null;
80+
window.alert = windowAlert;
7981
});
8082

8183
describe("Sandbox", function () {

0 commit comments

Comments
 (0)