Skip to content

Commit

Permalink
[fuchsia] Create //fuchsia_webengine
Browse files Browse the repository at this point in the history
//fuchsia/engine, //fuchsia/runners, and some other code will be moved
here in subsequent CLs.

Bug: 1081525
Change-Id: I9c20ddd6817aad3ea5ebaddb9a1511f43f3c6b7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3628360
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Erik Staab <estaab@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002221}
  • Loading branch information
ddorwin authored and Chromium LUCI CQ committed May 11, 2022
1 parent c4e4d69 commit 3ae377f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
4 changes: 4 additions & 0 deletions fuchsia_webengine/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include_rules = [
# Require explicit include rules for sub-directories.
"-fuchsia_webengine",
]
9 changes: 9 additions & 0 deletions fuchsia_webengine/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Metadata information for this directory.
#
# For more information on DIR_METADATA files, see:
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md
#
# For the schema of this file, see Metadata message:
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto

mixins: "//build/fuchsia/COMMON_METADATA"
2 changes: 2 additions & 0 deletions fuchsia_webengine/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set noparent
file://build/fuchsia/OWNERS
48 changes: 17 additions & 31 deletions fuchsia/README.md → fuchsia_webengine/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,33 @@
# Chromium-based Fuchsia services
This directory contains implementation code for various Fuchsia services living
in the Chromium repository. To build Chromium on Fuchsia, check this
# Fuchsia WebEngine and Runners
This directory contains implementation code for Fuchsia WebEngine and code
specifically related to it, including the Runners that use it.

For general information about building Chromium on Fuchsia, see this
[documentation](../docs/fuchsia/build_instructions.md).

[TOC]

## Code organization
Each of the following subdirectories contain code for a specific Fuchsia
service:
* `./engine` contains the WebEngine implementation. The WebEngine enables
* `./engine` contains the WebEngine implementation. WebEngine enables
Fuchsia applications to embed Chromium frames for rendering web content.
* `./runners`contains implementations of Fuchsia `sys.runner`.
* `./runners/cast` Enables the Fuchsia system to launch cast applications.
* `./runners/cast` Enables the Fuchsia system to launch Cast applications.
* `./runners/web` Enables the Fuchsia system to launch HTTP or HTTPS URLs.
* `./media_receiver` contains an implementation for an Open Screen receiver.

When writing a new Fuchsia service, it is recommended to create a new
subdirectory under `//fuchsia` or a new subdirectory under `//fuchsia/runners`
depending on the use case.

The `./base` subdirectory contains common utilities used by more than one of
the aforementioned Fuchsia services.

The `./cipd` and `./fidl` subdirectories contain CIPD definitions and FIDL
interface definitions, respectfully.

### Namespacing

Code that is not shared across multiple targets should live in the global
namespace. Code that is shared across multiple targets should live in the
`cr_fuchsia` namespace.

### Test code

Under the `//fuchsia` directory , there are 3 major types of tests:
* Unit tests: Exercises a single class in isolation, allowing full control
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: Spawns a full browser process along child processes. The test
* 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: they exercise the published API of a Fuchsia component. For
instance, `//fuchsia/engine:web_engine_integration_tests` make use of the
`//fuchsia/engine:web_engine` component. The test code is run in a separate
process in a separate component, allowing only access to the published API of
browser code - but not other processes.
* Integration tests: Exercise the published FIDL API of a Fuchsia Component. For
instance, `//fuchsia_webengine/engine:web_engine_integration_tests` make use of the
`//fuchsia_webengine/engine: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
Expand All @@ -51,8 +36,9 @@ 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`, `*_ browser_test.cc` or `*_integration_test.cc`.
`*_unittest.cc`, `*_ browsertest.cc` or `*_integration_test.cc`.

## TODO(crbug.com/1081525): Update and/or move the remaining text as appropriate.
Test code that is shared across components should live in a dedicated `test`
directory, under the `cr_fuchsia` namespace. For instance, see the
`//fuchsia/engine/test` directory, which contains code shared by all browser
Expand Down

0 comments on commit 3ae377f

Please sign in to comment.