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

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

Issue 841333002: Push API: rename registration to subscription. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use https in the spec link. Created 5 years, 11 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
« no previous file with comments | « LayoutTests/http/tests/push_messaging/unregister.html ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/push_messaging/unsubscribe.html
diff --git a/LayoutTests/http/tests/push_messaging/unregister.html b/LayoutTests/http/tests/push_messaging/unsubscribe.html
similarity index 48%
rename from LayoutTests/http/tests/push_messaging/unregister.html
rename to LayoutTests/http/tests/push_messaging/unsubscribe.html
index 2ddec8924a03b4c0557123d2797487bdf0e0df23..f119c26031457b26d9afb0c71d6ff9ce86040f9c 100644
--- a/LayoutTests/http/tests/push_messaging/unregister.html
+++ b/LayoutTests/http/tests/push_messaging/unsubscribe.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<title>Test PushRegistration.unregister()</title>
+<title>Test PushSubscription.unsubscribe()</title>
<link rel="manifest" href="resources/push_manifest.json">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
@@ -13,7 +13,7 @@ async_test(function(test) {
var workerUrl = 'resources/empty_worker.js';
var workerScope = 'resources/scope/' + location.pathname;
var swRegistration;
- var pushRegistration;
+ var pushSubscription;
service_worker_unregister_and_register(test, workerUrl, workerScope)
.then(function(serviceWorkerRegistration) {
swRegistration = serviceWorkerRegistration;
@@ -23,29 +23,29 @@ async_test(function(test) {
// If running manually, grant permission when prompted.
if (self.testRunner)
testRunner.setPushMessagingPermission(location.origin, true);
- return swRegistration.pushManager.register();
+ return swRegistration.pushManager.subscribe();
})
- .then(function(registration) {
- pushRegistration = registration;
- 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(subscription) {
+ pushSubscription = subscription;
+ assert_inherits(pushSubscription, 'unsubscribe',
+ 'unsubscribe() should be exposed on the PushSubscription object');
+ assert_equals(typeof(pushSubscription.unsubscribe), 'function',
+ 'PushSubscription.unsubscribe() is a function.');
+ return pushSubscription.unsubscribe();
})
- .then(function(unregistration_result) {
- assert_true(unregistration_result,
- "unregister() called when correctly registered should be fulfilled with true");
- return pushRegistration.unregister();
+ .then(function(unsubscription_result) {
+ assert_true(unsubscription_result,
+ "unsubscribe() called when correctly subscribed should be fulfilled with true");
+ return pushSubscription.unsubscribe();
})
- .then(function(unregistration_result) {
- assert_false(unregistration_result,
- "unregister() called a second time should be fulfilled with false");
- return swRegistration.pushManager.getRegistration();
+ .then(function(unsubscription_result) {
+ assert_false(unsubscription_result,
+ "unsubcribe() called a second time should be fulfilled with false");
+ return swRegistration.pushManager.getSubscription();
})
- .then(function(pushRegistration) {
- assert_equals(pushRegistration, null,
- "After unregistration, there is no more PushRegistration.");
+ .then(function(pushSubscription) {
+ assert_equals(pushSubscription, null,
+ "After unsubscription, there is no more PushSubscription.");
return service_worker_unregister_and_done(test, workerScope);
})
.catch(unreached_rejection(test));
« no previous file with comments | « LayoutTests/http/tests/push_messaging/unregister.html ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698