Jonathan Hao 2e1b05c9f5 Bug 1818563 [wpt PR 38684] - [Local Network Access] Make sure requests are not blocked in tests due to reasons other than LNA, a=testonly
Automatic update from web-platform-tests
[Local Network Access] Make sure requests are not blocked in tests due to reasons other than LNA

The concerned test cases are fetches, xhr, worker that initiated by
HTTPS iframes embedded in HTTP top level documents, so they're not in
secure contexts. Some of these test results look like it's blocking the
requests correctly, but in fact due to other reasons. Some requests fail
only because no preflights were sent, and some fail because of mixed
content check.

To make sure the LNA did kick in in these tests, we first added a
baseline local to local test case, which should succeed.
- If they don't succeed because of incorrect preflight expectation, we
  replace PreflightBehavior.success with optionalSuccess.
- If they don't succeed because of mixed content checks, we make them
  fetch via HTTPS instead.

With a succeeding baseline, we can now be sure that the other local
network requests are blocked because of LNA checks.

Change-Id: I3c7fbaca44a7eb79ded52f731f5a0b5dce9c3c5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4287245
Auto-Submit: Jonathan Hao <phao@chromium.org>
Reviewed-by: Titouan Rigoudy <titouan@chromium.org>
Commit-Queue: Jonathan Hao <phao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1109598}

--

wpt-commits: 6c562476fc76b15e9bbbbec8aa895cc66c3caaf7
wpt-pr: 38684
2023-03-07 00:23:47 +00:00

An explanation of the Firefox Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://firefox-source-docs.mozilla.org/contributing/directory_structure.html

For information on how to build Firefox from the source code and create the patch see:

    https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

If you have a question about developing Firefox, and can't find the solution
on https://firefox-source-docs.mozilla.org/, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel.


Nightly development builds can be downloaded from:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://www.mozilla.org/firefox/channel/desktop/#nightly

Keep in mind that nightly builds, which are used by Firefox developers for
testing, may be buggy.
Description
Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Readme 6.1 GiB
Languages
JavaScript 32.3%
C++ 25.4%
HTML 21.1%
C 10.8%
Python 2.8%
Other 7.1%