WebLayer is a high level embedding API to support building a browser.
Unlike src/content
, which is only concerned with a sandboxed multi-process web platform, WebLayer includes modern browser features and Google integration. It's the reusable version of Chrome, which might share some portions of the UI and also its support for all the modern HTML5 and browser features (e.g. UI for permissions, autofill, safe browsing etc...).
While it's built on top of src/content
, the expectation is that the API will hide the Content API.
Mailing list: weblayer-dev@chromium.org
Bug tracker: Internals>WebLayer
public
the C++ and Java public API. These are the only files an app should use
shell
sample app
test
test harnesses and test-only helper code
tools
helper scripts
app
internal code which runs at the beginning of each process
browser
internal code which runs in the browser process
common
internal code which runs in the browser and child processes
renderer
internal code which runs in the renderer process
utility
internal code which runs in the utility process
If you haven't done this already, you first need to set up an Android build. If you are a Google employee, reach out to weblayer-team@google.com for internal instructions. Otherwise follow the Android build instructions.
To run the sample app:
$ autoninja -C out/Default run_weblayer_shell $ out/Default/bin/run_weblayer_shell
To run instrumentation tests:
$ autoninja -C out/Default weblayer_instrumentation_test_apk $ out/Default/bin/run_weblayer_instrumentation_test_apk
Note: this may not work on some versions of Android. If you see an error setting the WebView provider when running instrumentation tests, try running the tests using the WebLayer support APK which uses a different loading path:
$ autoninja -C out/Default weblayer_support_instrumentation_test_apk $ out/Default/bin/run_weblayer_support_instrumentation_test_apk
The test script will build and install all necessary APKs.
Make sure you have the following gn arg:
system_webview_package_name = "com.google.android.webview"
The following tests the latest client library against M80:
$ autoninja -C out/Default weblayer_instrumentation_test_versions_apk $ cipd install --root /tmp/M80 chromium/testing/weblayer-x86 m80 $ out/Default/bin/run_weblayer_instrumentation_test_versions_apk \ --test-runner-outdir out/Default \ --client-outdir out/Default \ --implementation-outdir /tmp/M80/out/Release
To run WPT on android against weblayer do the following:
$ export WPT_TEST= test you want to run, relative to wpt directory. $ autoninja -C out/Default run_weblayer_shell weblayer_shell_wpt $ out/Default/bin/run_weblayer_shell $ testing/scripts/run_android_wpt.py --webdriver-binary=out/Default/clang_x64/chromedriver --product android_weblayer --isolated-script-test-output /tmp/weblayer_out.json --include ./third_party/blink/web_tests/external/wpt/$WPT_TEST
run_android_wpt.py
does not install weblayer-shell
, you need to do that yourself (executing run_weblayer_shell
will do that).
To run against clank:
$ autoninja -C out/Default monochrome_public_apk $ out/Default/bin/monochrome_public_apk install $ testing/scripts/run_android_wpt.py --webdriver-binary=out/Default/clang_x64/chromedriver --product chrome_android --package-name org.chromium.chrome --isolated-script-test-output /tmp/weblayer_out.json --include ./third_party/blink/web_tests/external/wpt/$WPT_TEST
Passing in -vvvv
may be useful if you want to see loads of information about test execution.
Telemetry is run against WebLayer, currently on the bot android-pixel2_weblayer-perf
.
Telemetry currently only runs on real hardware. Bug 1067712 is for adding support for emulators.
To see the set of stories executed, click on a successful run, search for performance_weblayer_test_suite
and click on the json.output
link.
Googlers can submit jobs against your own patch using pinpoint. At the time of this writing, logcat is not captured for successful runs (1067024). Submitting a pinpoint run against a patch with a CHECK will generate logcat. For such a run, the logcat is viewable by way of:
task
under Test
.+
(under More Details
).Isolated Outputs
.test_results.json
.gs://
with https://pantheon.corp.google.com/storage/browser
.