OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <script src="../../js/resources/js-test-pre.js"></script> |
| 4 <script src="resources/import-helpers.js"></script> |
| 5 <head> |
| 6 </head> |
| 7 <body> |
| 8 <script> |
| 9 |
| 10 waitAndTest([ |
| 11 { |
| 12 description: "It shouldn't be loaded before insertion.", |
| 13 setup: function() |
| 14 { |
| 15 window.placeholder = createPlaceholder(); |
| 16 window.toInsert = document.createElement("link"); |
| 17 window.toInsert.setAttribute("rel", "import"); |
| 18 window.toInsert.setAttribute("href", "resources/hello.html"); |
| 19 |
| 20 }, |
| 21 ready: function() { return window.placeholder.import; }, |
| 22 test: function() |
| 23 { |
| 24 shouldBeNull("toInsert.import"); |
| 25 } |
| 26 }, |
| 27 { |
| 28 description: "It should be loaded once it is inserted.", |
| 29 setup: function() |
| 30 { |
| 31 document.head.appendChild(window.toInsert); |
| 32 }, |
| 33 ready: function() { return toInsert.import; }, |
| 34 test: function() |
| 35 { |
| 36 shouldBe("toInsert.import.querySelector('h1').innerHTML", "'Hello'")
; |
| 37 } |
| 38 } |
| 39 ]); |
| 40 |
| 41 </script> |
| 42 <script src="../../js/resources/js-test-post.js"></script> |
| 43 </body> |
| 44 </html> |
OLD | NEW |