Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: LayoutTests/http/tests/notifications/request-permission-promise.html

Issue 1312623003: Flakyness: fix notifications/ tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@webmidi-flakyness
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/notifications/request-permission-promise.html
diff --git a/LayoutTests/http/tests/notifications/request-permission-promise.html b/LayoutTests/http/tests/notifications/request-permission-promise.html
index 5022eab41ab7cd9cd460bae062fbadc42fe6a5ef..92bd481b24832ecfc5cd233f677f8c91c4d6436c 100644
--- a/LayoutTests/http/tests/notifications/request-permission-promise.html
+++ b/LayoutTests/http/tests/notifications/request-permission-promise.html
@@ -4,6 +4,7 @@
<title>Notifications: Requesting permission using the Promise return value.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
+ <script src="../resources/permissions-helper.js"></script>
</head>
<body>
<script>
@@ -15,9 +16,9 @@
return Notification.requestPermission().then(permission => {
assert_equals(permission, 'denied');
- testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
+ return PermissionsHelper.setPermission('notifications', 'granted');
+ }).then(function() {
return Notification.requestPermission();
-
}).then(permission => {
assert_equals(permission, 'granted');
});
@@ -34,20 +35,19 @@
callbackPermission = value;
}
- testRunner.setPermission('notifications', 'denied', location.origin, location.origin);
-
- return Notification.requestPermission(permissionCallback).then(permission => {
- assert_equals(permission, 'denied');
- assert_equals(permission, callbackPermission);
-
- testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
- return Notification.requestPermission(permissionCallback);
-
- }).then(permission => {
- assert_equals(permission, 'granted');
- assert_equals(permission, callbackPermission);
- });
-
+ return PermissionsHelper.setPermission('notifications', 'denied').then(function() {
+ return Notification.requestPermission(permissionCallback).then(permission => {
+ assert_equals(permission, 'denied');
+ assert_equals(permission, callbackPermission);
+
+ return PermissionsHelper.setPermission('notifications', 'granted');
+ }).then(function() {
+ return Notification.requestPermission(permissionCallback);
+ }).then(permission => {
+ assert_equals(permission, 'granted');
+ assert_equals(permission, callbackPermission);
+ });
+ })
}, 'Requesting permission returns a promise, maintains the callback behaviour.');
</script>
</body>
« no previous file with comments | « LayoutTests/http/tests/notifications/close-document.html ('k') | LayoutTests/http/tests/notifications/update-document.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698