components/webapps/docs/projects/al-site-settings/testing_guide.md
This document describes how to test the TWA and WebAPK registration and site settings functionality manually and via automated tests.
To test manually using an emulator:
You can use a public PWA (like https://pokedex.org) or serve one locally.
https://pokedex.org.python3 -m http.server 8000.adb reverse tcp:8000 tcp:8000.Chrome requires Digital Asset Links verification to trust a TWA/WebAPK. For testing, you must disable this check for your test URL:
chrome://flags or command line):
--disable-digital-asset-link-verification-for-url="https://pokedex.org"--args:
out/Default/bin/chrome_public_apk launch --args="--disable-digital-asset-link-verification-for-url=https://pokedex.org"chrome://flags if not rooted):
adb shell "echo '_ --disable-digital-asset-link-verification-for-url=https://pokedex.org' > /data/local/tmp/chrome-command-line"You can use Bubblewrap to
generate an APK for your test site and install it:
adb install path/to/generated.apk
To test WebAPK installation:
https://pokedex.org).You can run instrumentation tests that execute on the emulator and show the UI.
These tests are located in
chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/:
TrustedWebActivityPreferencesUiTest.java: Tests the "Managed by" UI in site
settings.ManageTrustedWebActivityDataActivityTest.java: Tests the activity that
launches site settings from the TWA.Build the test APK (using out/AndroidDesktop for Desktop Android):
autoninja -C out/AndroidDesktop chrome_public_test_apk
Run the specific test:
out/AndroidDesktop/bin/run_chrome_public_test_apk -f "*TrustedWebActivityPreferencesUiTest*"