chromium/chrome/test/data/extensions/api_test/service_worker/messaging/send_message_tab_to_worker_one_way/service_worker_background.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.

chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
  chrome.test.sendMessage(
      msg == 'tab->worker' ? 'WORKER_RECEIVED_MESSAGE' : 'FAILURE');
});

chrome.test.sendMessage('WORKER_RUNNING');