Chromium Code Reviews| Index: LayoutTests/http/tests/security/suborigins/suborigin-blocked-notifications.php |
| diff --git a/LayoutTests/http/tests/security/suborigins/suborigin-blocked-notifications.php b/LayoutTests/http/tests/security/suborigins/suborigin-blocked-notifications.php |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5dddbe7eb41582019e678787d205eb54c108f5a7 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/security/suborigins/suborigin-blocked-notifications.php |
| @@ -0,0 +1,30 @@ |
| +<?php |
| +header("Content-Security-Policy: suborigin foobar1"); |
| +?> |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<title>Notifications are denied in suborigins.</title> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +</head> |
| +<script> |
| + async_test(function (test) { |
| + testRunner.grantWebNotificationPermission(location.origin, true); |
|
Mike West
2015/04/13 10:03:35
It would be good to discuss this kind of thing wit
|
| + Notification.requestPermission(function (status) { |
| + assert_equals(status, 'default'); |
| + |
| + var notification = new Notification('My Notification'); |
| + notification.addEventListener('show', function() { |
| + assert_unreached('The notification is not expected to be shown.'); |
| + }); |
| + |
| + notification.addEventListener('error', function() { |
| + test.done(); |
| + }); |
| + }); |
| + }, 'Notification creation fails when requested from a suborigin.'); |
| +</script> |
| +</script> |
| +<iframe id="iframe" src="resources/childsuborigin.php?suborigin=foobar2"></iframe> |
| +</html> |