chromium/chrome/test/data/extensions/api_test/service_worker/worker_based_background/fetch_file_scheme_url_with_file_access/service_worker_background.js

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

chrome.test.getConfig(function(config) {
  chrome.test.runTests([
    async function fetchFileSchemeResource() {
      var url = config.testDataDirectory + '/../test_file.txt';
      const response = await fetch(url);
      const text = await response.text();
      chrome.test.assertEq('Hello!', text);
      chrome.test.succeed();
    }
  ]);
});