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

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

Issue 793913002: Stub implementation for PushRegistration.unregister(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@mvan_6
Patch Set: rebase 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
Index: LayoutTests/http/tests/push_messaging/unregister.html
diff --git a/LayoutTests/http/tests/push_messaging/register_permission_denied.html b/LayoutTests/http/tests/push_messaging/unregister.html
similarity index 64%
copy from LayoutTests/http/tests/push_messaging/register_permission_denied.html
copy to LayoutTests/http/tests/push_messaging/unregister.html
index 179207aeb17f8c54fa1d7cf929a11b8088fbf0cc..e0e135bfb7ff18604df927b2d9949fce8a345728 100644
--- a/LayoutTests/http/tests/push_messaging/register_permission_denied.html
+++ b/LayoutTests/http/tests/push_messaging/unregister.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<title>register() is rejected when permission has been denied</title>
+<title>Test PushRegistration.unregister()</title>
<link rel="manifest" href="resources/push_manifest.json">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
@@ -19,20 +19,24 @@ async_test(function(test) {
return wait_for_state(test, swRegistration.installing, 'activated');
})
.then(function() {
- // If running manually, deny permission when prompted.
+ // If running manually, grant permission when prompted.
if (self.testRunner)
- testRunner.setPushMessagingPermission(location.origin, false);
+ testRunner.setPushMessagingPermission(location.origin, true);
return swRegistration.pushManager.register();
})
.then(function(pushRegistration) {
- assert_unreached('Registration must not succeed after permission is denied.');
- }, function(e) {
- assert_equals(e.name, 'AbortError');
- assert_equals(e.message, 'Registration failed - permission denied');
+ return pushRegistration.unregister();
Michael van Ouwerkerk 2014/12/12 12:18:04 nit for ultimate completeness: assert_inherits(pus
mlamouri (slow - plz ping) 2014/12/15 10:55:07 Done.
+ })
+ .then(function(unregistration_result) {
+ assert_true(unregistration_result);
Michael van Ouwerkerk 2014/12/12 12:18:04 nit: add 'Unregistration must succeed' as second a
mlamouri (slow - plz ping) 2014/12/15 10:55:07 Done.
+ // FIXME: we should add another call to unregister(). It should then
+ // fail.
+ // FIXME: we should check that there is no more push registration
+ // object available if we query the registrations.
return service_worker_unregister_and_done(test, workerScope);
})
.catch(unreached_rejection(test));
-}, 'register() is rejected when permission has been denied');
+}, 'unregister() succeeds if called after a successful registration');
</script>
</body>
</html>
« no previous file with comments | « no previous file | Source/bindings/core/v8/CallbackPromiseAdapter.h » ('j') | Source/bindings/core/v8/CallbackPromiseAdapter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698