Files
tubestation/testing/web-platform/tests/notifications/body-empty-manual.https.html
Dominick Ng d14854f8fe Bug 1739292 [wpt PR 31495] - Require Notifications be used in secure contexts, a=testonly
Automatic update from web-platform-tests
Restrict notifications to secure contexts.

This change migrates the notifications tests to use HTTPS. It also adds
new tests to ensure that permission cannot be requested from insecure
contexts.

--
Delete iframe test.

It's less clear that this is related to requiring a secure context
for notifications.

--
Simplify tests that match browsers today.

--
Add in rewritten constructor test

--

wpt-commits: b260fa988476799c97d3f3038ab7a18ae1e4a67c, 195cb6c52dc12c51d0d48dd17b978e1d6bf5afa0, f26159590c50a8dd8f5d0bf4c97dc9e3ec645673, daf2f7a44f2fddd832814b30626f338493cdd776
wpt-pr: 31495
2021-11-09 12:15:55 +00:00

32 lines
1.2 KiB
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Notification.body (empty string)</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
<div id=passfail></div>
<script>
setup({ explicit_timeout: true })
if (hasNotificationPermission()) {
async_test(function (t) {
t.step(function () {
var notification = null,
notifications = [],
text = "This is the title: New e-mail received"
createPassFail("If a notification appears containing the text "
+ "\"" + text + "\""
+ " but containing no body text other than any boilerplate"
+ " content the browser may automatically add to all"
+ " notifications (for example, some browsers show the origin"
+ " in the notification)", t, closeNotifications, notifications)
notification = new Notification(text, {
body: ""
})
notifications.push(notification)
})
})
}
</script>