Skip to content

Commit 5e2ba62

Browse files
authored
Merge pull request #75 from montmanu/issue-74
add support for mobileDevice REST API parameter
2 parents eefb6f4 + 3f3add0 commit 5e2ba62

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ _The default WPT server can also be specified via environment variable `WEBPAGET
106106
* **-N, --duration** _\<seconds\>_: minimum test duration in seconds
107107
* **-E, --tester** _\<name\>_: run the test on a specific PC (name must match exactly or the test will not run)
108108
* **-W, --mobile**: (experimental) emulate mobile browser: Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport (Chrome only)
109+
* **--device** _\<string\>_: device name from mobile_devices.ini to use for mobile emulation (only when mobile=1 is specified to enable emulation and only for Chrome)
109110
* **-M, --timeline**: capture Developer Tools Timeline (Chrome only)
110111
* **-J, --callstack**: set between 1-5 to include the JS call stack. must be used in conjunction with timeline (increases overhead) (Chrome only)
111112
* **-q, --chrometrace**: capture chrome trace (about://tracing) (Chrome only)

lib/mapping.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ var options = {
162162
bool: true,
163163
info: '(experimental) emulate mobile browser: Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport (Chrome only)'
164164
},
165+
'device': {
166+
name: 'device',
167+
api: 'mobileDevice',
168+
param: 'string',
169+
info: 'device name from mobile_devices.ini to use for mobile emulation (only when mobile=1 is specified to enable emulation and only for Chrome)'
170+
},
165171
'timeline': {
166172
name: 'timeline',
167173
key: 'M',

test/fixtures/command-line/help-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
-N, --duration <seconds> minimum test duration in seconds
2727
-E, --tester <name> run the test on a specific PC (name must match exactly or the test will not run)
2828
-W, --mobile (experimental) emulate mobile browser: Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport (Chrome only)
29+
--device <string> device name from mobile_devices.ini to use for mobile emulation (only when mobile=1 is specified to enable emulation and only for Chrome)
2930
-M, --timeline capture Developer Tools Timeline (Chrome only)
3031
-J, --callstack set between 1-5 to include the JS call stack. must be used in conjunction with timeline (increases overhead) (Chrome only)
3132
-q, --chrometrace capture chrome trace (about://tracing) (Chrome only)

0 commit comments

Comments
 (0)