blob: 8b72b1af340ab4f04713d198d25be0a95ab9e7d2 [file] [log] [blame]
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
<script src="resources/web-intents-testing.js"></script>
<script>
var channel = new MessageChannel();
channel.port2.onMessage = function(e) {
debug("* got message");
};
function buttonClicked() {
try {
var intent1 = new WebKitIntent("action1", "mime/type1", channel.port1, "not a port");
testFailed("Should have thrown TypeError");
} catch (e) {
if (!(e instanceof TypeError)) testFailed("Should throw type error on non-port arg");
}
try {
var intent1 = new WebKitIntent("action1", "mime/type1", channel.port1, ["not a port"]);
testFailed("Should have thrown TypeError");
} catch (e) {
if (!(e instanceof TypeError)) testFailed("Should throw type error on non-port arg");
}
navigator.webkitStartActivity(new WebKitIntent("action1", "mime/type1", channel.port1, [channel.port1]));
debug("* sent intent");
}
</script>
</head>
<body onload="simulateButtonPress()">
<input type="button" id="button" value="Start Web Intent" onmouseup="buttonClicked()">
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>