blob: bbeb5927b41ed3c2d8d3272be9a1aa3013dba353 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<dialog>
<form method="dialog">
<input id="goodbye" type="submit" value="Goodbye">
<input id="hello" type="submit" value="Hello">
</form>
</dialog>
<script>
description('Tests submitting a dialog on a close event triggered by a previous submission.');
window.jsTestIsAsync = true;
function testGoodbye()
{
dialog = document.querySelector('dialog');
dialog.show();
dialog.addEventListener('close', function f() {
dialog.removeEventListener('close', f);
shouldBeFalse('dialog.open');
shouldBeEqualToString('dialog.returnValue', 'Goodbye');
testHello();
});
document.querySelector('#goodbye').click();
}
function testHello()
{
dialog = document.querySelector('dialog');
dialog.show();
dialog.addEventListener('close', function() {
shouldBeFalse('dialog.open');
shouldBeEqualToString('dialog.returnValue', 'Hello');
finishJSTest();
});
document.querySelector('#hello').click();
}
testGoodbye();
</script>
</body>
</html>