0
Files
src/fuchsia_web
Devlin Cronin df260f5e98 [Extensions] Allow service worker requests to continue without a cert
Certain requests may request, but not require, a client cert. Today,
this will result in one of three things happening if there isn't a
client cert available (either from a previous request or from
enterprise policy):
1) The request will fail
2) The user will be shown a cert picker dialog
3) The request will continue without a certificate

On desktop platforms for WebContents-based requesting contexts:
* If there are no certs to choose from, the request will continue
  without a cert.
* If there are client certs and the WebContents supports showing
  dialogs, the cert picker will be shown.
* If there are certs and the WebContents does not support showing
  dialogs, the request will fail.

On Android for WebContents-based requesting contexts:
* We will always call out to the native cert-picker, which may or
  may not show a dialog (depending on other device configurations
  which Chrome doesn't know about).

On desktop and Android platforms for service worker requesting
contexts:
* The request will always fail.

This CL changes this behavior to allow requests from extension
background service workers to proceed without a client cert if there
are no certs to choose from; this then matches the behavior for
extension background and offscreen WebContents (which do not support
showing dialogs).

Bug: 333954429
Change-Id: Ia6111f3bd499998d6244945daa13ac67774804bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455480
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322530}
2024-07-03 02:13:39 +00:00
..

fuchsia.web - Fuchsia WebEngine and Runners

This directory contains code related to the fuchsia.web FIDL API. Specifically, it contains the implementation of Fuchsia WebEngine and code related to it, including the Runners that use it. Code in this directory must not be used outside it and its subdirectories.

General information about Chromium on Fuchsia is here.

[TOC]

Code organization

Each of the following subdirectories contain code for a specific Fuchsia service:

  • ./common contains code shared by both WebEngine and Runners.
  • ./runnerscontains implementations of Fuchsia sys.runner.
    • ./runners/cast Enables the Fuchsia system to launch Cast applications.
  • ./shell contains WebEngineShell, a simple wrapper for launching URLs in WebEngine from the command line.
  • ./webengine contains the WebEngine implementation. WebEngine is an implementation of fuchsia.web that enables Fuchsia Components to render web content using Chrome's Content layer.
  • ./webinstance_host contains code for WebEngine clients to directly instantiate a WebInstance Component (web_instance.cm) using the WebEngine package.

Test code

There are 3 major types of tests within this directory:

  • Unit tests: Exercise a single class in isolation, allowing full control over the external environment of this class.
  • Browser tests: Spawn a full browser process and its child processes. The test code is run inside the browser process, allowing for full access to the browser code - but not other processes.
  • Integration tests: Exercise the published FIDL API of a Fuchsia Component. For instance, //fuchsia_web/webengine:web_engine_integration_tests make use of the //fuchsia_web/webengine:web_engine component. The test code runs in a separate process in a separate Fuchsia Component, allowing only access to the published API of the component under test.

Integration tests are more resource-intensive than browser tests, which are in turn more expensive than unit tests. Therefore, when writing new tests, it is preferred to write unit tests over browser tests over integration tests.

As a general rule, test-only code should live in the same directory as the code under test with an explicit file name, either fake_*, test_*, *_unittest.cc, *_ browsertest.cc or *_integration_test.cc.

Test code that is shared across Components should live in a dedicated ``test directory. For example, the //fuchsia_web/webengine/test directory, which contains code shared by all browser tests, and //fuchsia_web/common/test, which contains code shared by tests for both WebEngine and Runners.