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

Unified Diff: LayoutTests/http/tests/push_messaging/has_permission_default.html

Issue 783983003: Push API: move PushManager from Navigator to ServiceWorkerRegistration [switchover 6/6] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments. Created 6 years 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/push_messaging/has_permission_denied.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/push_messaging/has_permission_default.html
diff --git a/LayoutTests/http/tests/push_messaging/has_permission_default.html b/LayoutTests/http/tests/push_messaging/has_permission_default.html
new file mode 100644
index 0000000000000000000000000000000000000000..37021e1fe26e4b2aef4b1c0a9c33d35e586054e5
--- /dev/null
+++ b/LayoutTests/http/tests/push_messaging/has_permission_default.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Push API: hasPermission resolves with default when no permission is set</title>
+<link rel="manifest" href="resources/push_manifest.json">
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../serviceworker/resources/test-helpers.js"></script>
+</head>
+<body>
+<script>
+async_test(function(test) {
+ var workerUrl = 'resources/empty_worker.js';
+ var workerScope = 'resources/scope/' + location.pathname;
+ service_worker_unregister_and_register(test, workerUrl, workerScope)
+ .then(function(serviceWorkerRegistration) {
+ // If running manually, clear permissions before running this test.
+ if (self.testRunner)
+ testRunner.clearPushMessagingPermissions();
+ return serviceWorkerRegistration.pushManager.hasPermission();
+ })
+ .then(function(permissionStatus) {
+ assert_equals(permissionStatus, 'default');
+ return service_worker_unregister_and_done(test, workerScope);
+ })
+ .catch(unreached_rejection(test));
+}, 'Push API: hasPermission resolves with default when permission is not set');
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/push_messaging/has_permission_denied.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698