blob: cc74cad15170890c3ae4d5aca02792a1f4bc54a6 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
assert_true('presentation' in navigator);
assert_true('defaultRequest' in navigator.presentation);
assert_true('PresentationRequest' in window);
}, "Test that the Presentation API is present.")
test(function() {
assert_equals(typeof(navigator.presentation), "object");
assert_equals(typeof(navigator.presentation.defaultRequest), "object");
}, "Test the Presentation API property types.");
test(function() {
assert_false(navigator.presentation instanceof EventTarget);
}, "Test that navigator.presentation is not an EventTarget.");
test(function() {
var request = new PresentationRequest('http://foo.html');
assert_equals(typeof(request.start), "function");
assert_equals(typeof(request.reconnect), "function");
assert_equals(typeof(request.getAvailability), "function");
assert_equals(typeof(request.onconnectionavailable), "object");
assert_true(request instanceof EventTarget);
}, "Test PresentationRequest API types for a single URL.");
test(function() {
var request = new PresentationRequest(["http://example.com", "cast://google.com/app_id=deadbeef"]);
assert_equals(typeof(request.start), "function");
assert_equals(typeof(request.reconnect), "function");
assert_equals(typeof(request.getAvailability), "function");
assert_equals(typeof(request.onconnectionavailable), "object");
assert_true(request instanceof EventTarget);
}, "Test PresentationRequest API types for multiple URLs.");
</script>
</body>
</html>