From 4cf1ca97891233cdef5ca1dfb4709d96436b9b23 Mon Sep 17 00:00:00 2001 From: Jan Scheffler Date: Sat, 11 Sep 2021 09:55:52 +0200 Subject: [PATCH] Add more emulated Android phones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds: Galaxy S8 Galaxy S9+ Galaxy Tab S4 Pixel 3 Pixel 4 These devices are regarded as worthy of targeting by https://www.browserstack.com/test-on-the-right-mobile-devices Sources (both have identical data for these 5 devices): 1. https://github.com/aerokube/moon-deploy/blob/master/moon-local.yaml#L199 2. https://www.danhendricks.com/2018/04/adding-iphone-galaxy-chrome-mobile-emulated-devices/#heading_device_data The same changes (structured differently) have been added to Playwright ( https://github.com/microsoft/playwright/pull/6413 ). This PR was suggested by @mathiasbynens, see https://github.com/puppeteer/puppeteer/pull/7210 Change-Id: I70db28b15b77fcdb82171a08ebd0b33aa0886621 Bug: None Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2919612 Reviewed-by: Jan Scheffler Reviewed-by: Changhao Han Reviewed-by: Peter Müller Reviewed-by: Mraz Marian Reviewed-by: Alex Rudenko Reviewed-by: Paul Lewis Reviewed-by: Mathias Bynens Commit-Queue: Jan Scheffler --- AUTHORS | 1 + front_end/models/emulation/EmulatedDevices.ts | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/AUTHORS b/AUTHORS index afc54dad71a..313aa4e2aa5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -34,6 +34,7 @@ Karntino Areros Krishnal Ciccolella Luke Swiderski Michael Brüning +Michael Rienstra Per-Olov Jernberg PhistucK Pradhuman Singh Baid diff --git a/front_end/models/emulation/EmulatedDevices.ts b/front_end/models/emulation/EmulatedDevices.ts index 1711ece3746..88993aebc14 100644 --- a/front_end/models/emulation/EmulatedDevices.ts +++ b/front_end/models/emulation/EmulatedDevices.ts @@ -1041,6 +1041,36 @@ const emulatedDevices = [ {'platform': 'Android', 'platformVersion': '8.0.0', 'architecture': '', 'model': 'Pixel 2 XL', 'mobile': true}, 'type': 'phone', }, + { + 'show-by-default': false, + 'title': 'Pixel 3', + 'screen': { + 'horizontal': {'width': 786, 'height': 393}, + 'device-pixel-ratio': 2.75, + 'vertical': {'width': 393, 'height': 786}, + }, + 'capabilities': ['touch', 'mobile'], + 'user-agent': + 'Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36', + 'user-agent-metadata': + {'platform': 'Android', 'platformVersion': '9', 'architecture': '', 'model': 'Pixel 3', 'mobile': true}, + 'type': 'phone', + }, + { + 'show-by-default': false, + 'title': 'Pixel 4', + 'screen': { + 'horizontal': {'width': 745, 'height': 353}, + 'device-pixel-ratio': 3, + 'vertical': {'width': 353, 'height': 745}, + }, + 'capabilities': ['touch', 'mobile'], + 'user-agent': + 'Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36', + 'user-agent-metadata': + {'platform': 'Android', 'platformVersion': '10', 'architecture': '', 'model': 'Pixel 4', 'mobile': true}, + 'type': 'phone', + }, { 'show-by-default': false, 'title': 'LG Optimus L70', @@ -1139,6 +1169,51 @@ const emulatedDevices = [ {'platform': 'Android', 'platformVersion': '5.0', 'architecture': '', 'model': 'SM-G900P', 'mobile': true}, 'type': 'phone', }, + { + 'show-by-default': false, + 'title': 'Galaxy S8', + 'screen': { + 'horizontal': {'width': 740, 'height': 360}, + 'device-pixel-ratio': 3, + 'vertical': {'width': 360, 'height': 740}, + }, + 'capabilities': ['touch', 'mobile'], + 'user-agent': + 'Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36', + 'user-agent-metadata': + {'platform': 'Android', 'platformVersion': '7.0', 'architecture': '', 'model': 'SM-G950U', 'mobile': true}, + 'type': 'phone', + }, + { + 'show-by-default': false, + 'title': 'Galaxy S9+', + 'screen': { + 'horizontal': {'width': 658, 'height': 320}, + 'device-pixel-ratio': 4.5, + 'vertical': {'width': 320, 'height': 658}, + }, + 'capabilities': ['touch', 'mobile'], + 'user-agent': + 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36', + 'user-agent-metadata': + {'platform': 'Android', 'platformVersion': '8.0.0', 'architecture': '', 'model': 'SM-G965U', 'mobile': true}, + 'type': 'phone', + }, + { + 'show-by-default': false, + 'title': 'Galaxy Tab S4', + 'screen': { + 'horizontal': {'width': 1138, 'height': 712}, + 'device-pixel-ratio': 2.25, + 'vertical': {'width': 712, 'height': 1138}, + }, + 'capabilities': ['touch', 'mobile'], + 'user-agent': + 'Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36', + 'user-agent-metadata': + {'platform': 'Android', 'platformVersion': '8.1.0', 'architecture': '', 'model': 'SM-T837A', 'mobile': true}, + 'type': 'phone', + }, { 'order': 1, 'show-by-default': false,