Bug 1927677 - part 3 - Show the navbar divider in the same layout as the navbar r...
[gecko.git] / toolkit / components / pdfjs / test / test_pdf_file_in_iframe.html
blob2527cdb71e0d4499340448c9280375b2bec80f29
1 <!DOCTYPE html>
2 <html>
4 <head>
5 <meta charset="utf-8">
6 <title>PDFjs: Load a PDF in an iframe.</title>
7 <script src="/tests/SimpleTest/SimpleTest.js"></script>
8 <script src="/tests/SimpleTest/EventUtils.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
12 <body>
13 <pre id="test">
14 <script type="text/javascript">
15 "use strict";
17 async function test() {
18 await SpecialPowers.pushPrefEnv({
19 "set": [["pdfjs.disabled", false]],
20 });
22 const iframe = document.createElement("iframe");
23 document.body.append(iframe);
24 iframe.src = "file_pdfjs_test.pdf";
25 iframe.onload = async () => {
26 const hasViewerContainer = await SpecialPowers.spawn(
27 iframe.contentWindow,
28 [],
29 () => !!this.content.document.getElementById("viewerContainer")
31 ok(
32 hasViewerContainer,
33 "The iframe with a pdf must have a `viewerContainer`"
35 SimpleTest.finish();
39 window.onload = () => {
40 SimpleTest.waitForExplicitFinish();
41 test();
43 </script>
44 </pre>
45 </body>
47 </html>