chromium/chrome/test/data/background_sync/background_sync_service_worker.js

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

// Service Worker initialization listeners.
self.addEventListener('install', e => e.waitUntil(skipWaiting()));
self.addEventListener('activate', e => e.waitUntil(clients.claim()));

self.addEventListener('sync', e => {
  e.waitUntil(fetch(
    '/background_sync/background_sync_browsertest.html?syncreceived'));
});