blob: 8e4745824d31e500af26b9947575a984231c5150 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src='../resources/testharness.js'></script>
<script src='../resources/testharnessreport.js'></script>
<iframe sandbox='allow-scripts allow-same-origin allow-presentation'></iframe>
<script>
async_test(function(t) {
window.onmessage = t.step_func_done(function(e) {
e.data.forEach(function(result) {
if (result.test == 'getAvailability') {
assert_equals(result.status, 'success', result.test);
return;
}
// TODO(mlamouri): we are only testing that it doesn't fail for security
// reasons because the request will still fail for lack of devices/backend.
assert_equals(result.status, 'failure', result.test);
assert_not_equals(result.name, 'SecurityError', result.test);
});
});
document.querySelector('iframe').src = 'resources/embedded-smoke-tests.html';
}, 'Test that calling Presentation API works from inside a sandboxed iframe with "allow-presentation".');
</script>
</body>
</html>