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

Unified Diff: content/test/data/background_sync/background_sync_test_helpers.js

Issue 1282013004: BackgroundSyncManager tracks client registrations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test 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: content/test/data/background_sync/background_sync_test_helpers.js
diff --git a/content/test/data/background_sync/background_sync_test_helpers.js b/content/test/data/background_sync/background_sync_test_helpers.js
index 07465387f254aa0b4a3ee4778a420697d225b5aa..e48bfb85ab2cdd2b6a64babffc906d39bd34a2a5 100644
--- a/content/test/data/background_sync/background_sync_test_helpers.js
+++ b/content/test/data/background_sync/background_sync_test_helpers.js
@@ -42,6 +42,45 @@ function registerOneShot(tag) {
.catch(sendErrorToTest);
}
+function unregisterOneShot(tag) {
+ navigator.serviceWorker.ready
+ .then(function(swRegistration) {
+ return swRegistration.sync.getRegistration(tag);
+ })
+ .then(function(syncRegistration) {
+ if (!syncRegistration) {
+ sendResultToTest('error - ' + tag + ' not found');
+ return;
+ }
+ return syncRegistration.unregister();
+ })
+ .then(function() {
+ sendResultToTest('ok - ' + tag + ' unregistered');
+ })
+ .catch(sendErrorToTest);
+}
+
+function unregisterOneShotTwice(tag) {
+ navigator.serviceWorker.ready
+ .then(function(swRegistration) {
+ return swRegistration.sync.getRegistration(tag);
+ })
+ .then(function(syncRegistration) {
+ if (!syncRegistration) {
+ sendResultToTest('error - ' + tag + ' not found');
+ return;
+ }
+ return syncRegistration.unregister();
+ })
+ .then(function() {
+ return syncRegistration.unregister();
+ })
+ .then(sendErrorToTest, function() {
+ sendResultToTest('ok - ' + tag + ' failed to unregister twice');
+ })
+ .catch(sendErrorToTest);
+}
+
function getRegistrationOneShot(tag) {
navigator.serviceWorker.ready
.then(function(swRegistration) {
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.cc ('k') | content/test/data/background_sync/service_worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698