| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <script src="../../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| description('Test window DOMContentLoaded event is fired after module is executed.'); |
| |
| // Module will be executed asynchronously. |
| window.jsTestIsAsync = true; |
| </script> |
| <script> |
| debug('Module is not executed yet.'); |
| window.domContentLoadedIsExecuted = false; |
| window.addEventListener('DOMContentLoaded', function () { |
| window.domContentLoadedIsExecuted = true; |
| }, false); |
| shouldBe(`document.readyState`, `"loading"`); |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| <script type="module"> |
| shouldBe(`document.readyState`, `"interactive"`); |
| shouldBe(`domContentLoadedIsExecuted`, `false`); |
| window.addEventListener('DOMContentLoaded', function () { |
| finishJSTest(); |
| }, false); |
| </script> |
| </body> |
| </html> |