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

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: remove trace 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 | Source/bindings/core/v8/CallbackPromiseAdapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/push_messaging/unregister.html
diff --git a/LayoutTests/http/tests/push_messaging/register_success.html b/LayoutTests/http/tests/push_messaging/unregister.html
similarity index 56%
copy from LayoutTests/http/tests/push_messaging/register_success.html
copy to LayoutTests/http/tests/push_messaging/unregister.html
index 13db7e0822ce9bc7b86ae012fff148bb83b2e07d..5702267b6dced4fb2432f198a416b43fa0afaaa2 100644
--- a/LayoutTests/http/tests/push_messaging/register_success.html
+++ b/LayoutTests/http/tests/push_messaging/unregister.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<title>register() succeeds when permission is granted and resolves with a valid registration</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>
@@ -25,21 +25,23 @@ async_test(function(test) {
return swRegistration.pushManager.register();
})
.then(function(pushRegistration) {
- assert_own_property(pushRegistration, 'pushRegistrationId');
- assert_equals(typeof pushRegistration.pushRegistrationId, 'string');
-
- assert_own_property(pushRegistration, 'pushEndpoint');
- assert_equals(typeof pushRegistration.pushEndpoint, 'string');
- try {
- var endpointUrl = new URL(pushRegistration.pushEndpoint);
- } catch(e) {
- assert_unreached('Constructing a URL from the endpoint should not throw.');
- }
-
+ assert_inherits(pushRegistration, 'unregister',
+ 'unregister() should be exposed on the PushRegistration object');
+ assert_equals(typeof(pushRegistration.unregister), 'function',
+ 'PushRegistration.unregister() is a function.');
+ return pushRegistration.unregister();
+ })
+ .then(function(unregistration_result) {
+ assert_true(unregistration_result,
+ 'Unregistering a registered PushRegistration should succeed.');
+ // 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() succeeds when permission is granted and resolves with a valid registration');
+}, '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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698