blob: ef6d3890ea6a8125e4c515070c69ed6f0cfbad67 [file] [log] [blame]
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector/resources/protocol-test.js"></script>
<script>
window.addEventListener("beforeunload", onBeforeUnload);
function onBeforeUnload()
{
window.removeEventListener("beforeunload", onBeforeUnload);
return "beforeunload in javascriptDialogEvents";
}
function test()
{
InspectorProtocol.eventHandler["Page.javascriptDialogOpening"] = onOpening;
InspectorProtocol.eventHandler["Page.javascriptDialogClosed"] = onClosed;
InspectorProtocol.sendCommand("Page.enable", {});
function onOpening(event)
{
ProtocolTest.log("Opening with message: " + event.params.message);
}
function onClosed()
{
ProtocolTest.log("Closed");
}
InspectorProtocol.sendCommand("Page.navigate", { "url": "nosuchurl" });
InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "alert('alert')" });
InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "confirm('confirm')" });
InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "prompt('prompt')" }, onDone);
function onDone()
{
ProtocolTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
</body>
</html>