| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <dialog> | |
| 8 <form method="dialog"> | |
| 9 <input id="goodbye" type="submit" value="Goodbye"> | |
| 10 <input id="hello" type="submit" value="Hello"> | |
| 11 </form> | |
| 12 </dialog> | |
| 13 <script> | |
| 14 description('Tests submitting a dialog on a close event triggered by a previous
submission.'); | |
| 15 | |
| 16 window.jsTestIsAsync = true; | |
| 17 function testGoodbye() | |
| 18 { | |
| 19 dialog = document.querySelector('dialog'); | |
| 20 dialog.show(); | |
| 21 dialog.addEventListener('close', function f() { | |
| 22 dialog.removeEventListener('close', f); | |
| 23 shouldBeFalse('dialog.open'); | |
| 24 shouldBeEqualToString('dialog.returnValue', 'Goodbye'); | |
| 25 testHello(); | |
| 26 }); | |
| 27 document.querySelector('#goodbye').click(); | |
| 28 } | |
| 29 | |
| 30 function testHello() | |
| 31 { | |
| 32 dialog = document.querySelector('dialog'); | |
| 33 dialog.show(); | |
| 34 dialog.addEventListener('close', function() { | |
| 35 shouldBeFalse('dialog.open'); | |
| 36 shouldBeEqualToString('dialog.returnValue', 'Hello'); | |
| 37 finishJSTest(); | |
| 38 }); | |
| 39 document.querySelector('#hello').click(); | |
| 40 } | |
| 41 | |
| 42 testGoodbye(); | |
| 43 </script> | |
| 44 </body> | |
| 45 </html> | |
| OLD | NEW |