| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <dialog id="test-dialog"></dialog> | 7 <dialog id="test-dialog"></dialog> |
| 8 <script> | 8 <script> |
| 9 description("Tests that dialog.returnValue is settable and returns the last valu
e set."); | 9 description("Tests that dialog.returnValue is settable and returns the last valu
e set."); |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 dialog.show(); | 34 dialog.show(); |
| 35 dialog.close(null); | 35 dialog.close(null); |
| 36 shouldBe("dialog.returnValue", "'null'"); | 36 shouldBe("dialog.returnValue", "'null'"); |
| 37 | 37 |
| 38 dialog.returnValue = 'Should not change because no argument to close()'; | 38 dialog.returnValue = 'Should not change because no argument to close()'; |
| 39 dialog.show(); | 39 dialog.show(); |
| 40 dialog.close(); | 40 dialog.close(); |
| 41 shouldBe("dialog.returnValue", "'Should not change because no argument to close(
)'"); | 41 shouldBe("dialog.returnValue", "'Should not change because no argument to close(
)'"); |
| 42 | 42 |
| 43 dialog.returnValue = 'Should not change because of undefined argument to close()
'; |
| 44 dialog.show(); |
| 45 dialog.close(undefined); |
| 46 shouldBe("dialog.returnValue", "'Should not change because of undefined argument
to close()'"); |
| 47 |
| 43 dialog.returnValue = 'Should not change because close() is invalid'; | 48 dialog.returnValue = 'Should not change because close() is invalid'; |
| 44 shouldThrow("dialog.close('blah')", '"InvalidStateError: Failed to execute \'clo
se\' on \'HTMLDialogElement\': The element does not have an \'open\' attribute,
and therefore cannot be closed."'); | 49 shouldThrow("dialog.close('blah')", '"InvalidStateError: Failed to execute \'clo
se\' on \'HTMLDialogElement\': The element does not have an \'open\' attribute,
and therefore cannot be closed."'); |
| 45 shouldBe("dialog.returnValue", "'Should not change because close() is invalid'")
; | 50 shouldBe("dialog.returnValue", "'Should not change because close() is invalid'")
; |
| 46 </script> | 51 </script> |
| 47 </body> | 52 </body> |
| 48 </html> | 53 </html> |
| OLD | NEW |