Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: roll Android WebView to ToT (#35456)

Max Schmitt67d92f0f103e
diff --git a/tests/android/webview.spec.ts b/tests/android/webview.spec.ts
index efe6de2931..a75606cf6c 100644
--- a/tests/android/webview.spec.ts
+++ b/tests/android/webview.spec.ts
@@ -70,7 +70,7 @@ test('select webview from socketName', async function({ androidDevice }) {
await context.close();
});
-test.fixme('should be able to receive webView cookies', {
+test('should be able to receive webView cookies', {
annotation: {
type: 'issue',
description: 'https://github.com/microsoft/playwright/issues/35392',
diff --git a/utils/avd_start.sh b/utils/avd_start.sh
index 1c3bc53418..9df4272e92 100755
--- a/utils/avd_start.sh
+++ b/utils/avd_start.sh
@@ -10,18 +10,26 @@ bash $PWD/utils/avd_stop.sh
echo "Starting emulator"
# nohup ${ANDROID_HOME}/emulator/emulator -avd android35 -gpu swiftshader &
-nohup ${ANDROID_HOME}/emulator/emulator -avd android35 -no-audio -no-window -no-boot-anim -no-snapshot &
+nohup ${ANDROID_HOME}/emulator/emulator -avd android35 -no-audio -no-window -no-boot-anim -no-snapshot -writable-system &
${ANDROID_HOME}/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
${ANDROID_HOME}/platform-tools/adb devices
echo "Emulator started"
echo "Installing Chromium WebView"
# See here for the latest revision: https://storage.googleapis.com/chromium-browser-snapshots/Android/LAST_CHANGE
-CHROMIUM_ANDROID_REVISION="1340145"
+CHROMIUM_ANDROID_REVISION="1441404"
WEBVIEW_TMP_DIR="$(mktemp -d)"
-WEBVIEW_TMP_FILE="$WEBVIEW_TMP_DIR/chrome-android-zip"
-curl -s -o "${WEBVIEW_TMP_FILE}" "https://storage.googleapis.com/chromium-browser-snapshots/Android/${CHROMIUM_ANDROID_REVISION}/chrome-android.zip"
-unzip -q "${WEBVIEW_TMP_FILE}" -d "${WEBVIEW_TMP_DIR}"
+
+curl -s --fail --retry 5 -o "$WEBVIEW_TMP_DIR/chrome-android.zip" "https://storage.googleapis.com/chromium-browser-snapshots/Android/${CHROMIUM_ANDROID_REVISION}/chrome-android.zip"
+unzip -q "$WEBVIEW_TMP_DIR/chrome-android.zip" -d "${WEBVIEW_TMP_DIR}"
+
+if [[ "$(uname -m)" == "arm64" ]]; then
+ curl -s --fail --retry 5 -o "$WEBVIEW_TMP_DIR/chrome-android-arm64.zip" "https://storage.googleapis.com/chromium-browser-snapshots/Android_Arm64/${CHROMIUM_ANDROID_REVISION}/chrome-android.zip"
+ unzip -o -q "$WEBVIEW_TMP_DIR/chrome-android-arm64.zip" -d "${WEBVIEW_TMP_DIR}"
+fi
+# SystemWebViewShell.apk is ABI-neutral, so we can use it for both arm and arm64. Its not contained in the arm64 zip.
${ANDROID_HOME}/platform-tools/adb install -r "${WEBVIEW_TMP_DIR}/chrome-android/apks/SystemWebViewShell.apk"
+${ANDROID_HOME}/platform-tools/adb install -r "${WEBVIEW_TMP_DIR}/chrome-android/apks/SystemWebView.apk"
+
rm -rf "${WEBVIEW_TMP_DIR}"
echo "Chromium WebView installed"