b0c86773297c8def214e5501f951c6c5c1686f87
[WebKit-https.git] / LayoutTests / fast / attachment / attachment-dom.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script>
6     if (window.internals)
7         window.internals.settings.setAttachmentElementEnabled(true)
8 </script>
9 <script src="../../resources/js-test-pre.js"></script>
10 </head>
11 <body>
12 <script>
13
14 description("This tests that attachments have an instance type of HTMLElement.");
15
16 var attachment = document.createElement("attachment");
17 shouldBeType("attachment", "HTMLAttachmentElement");
18
19 var file;
20 if (window.internals) {
21     file = window.internals.createFile("resources/test-file.txt");
22 }
23
24 shouldBeNull("attachment.file");
25
26 debug("Setting attachment.file to a file created from resources/test-file.txt")
27 attachment.file = file;
28 shouldBe("attachment.file", "file");
29 shouldBe("attachment.file.name", "'test-file.txt'");
30 </script>
31 <script src="../../resources/js-test-post.js"></script>
32 </body>
33 </html>