@@ -33,44 +33,52 @@ var argv = require('yargs')
33
33
34
34
var browsers = argv [ 'browsers' ] . split ( ',' ) ;
35
35
36
+ var CHROME_OPTIONS = {
37
+ 'args' : [ '--js-flags=--expose-gc' ] ,
38
+ 'perfLoggingPrefs' : {
39
+ 'traceCategories' : 'blink.console,disabled-by-default-devtools.timeline'
40
+ }
41
+ } ;
42
+
43
+ var CHROME_MOBILE_EMULATION = {
44
+ // Can't use 'deviceName':'Google Nexus 7 2'
45
+ // as this would yield wrong orientation,
46
+ // so we specify facts explicitly
47
+ 'deviceMetrics' : {
48
+ 'width' : 600 ,
49
+ 'height' : 960 ,
50
+ 'pixelRatio' : 2
51
+ }
52
+ } ;
53
+
36
54
var BROWSER_CAPS = {
37
55
Dartium : {
38
56
name : 'Dartium' ,
39
57
browserName : 'chrome' ,
40
- chromeOptions : {
41
- 'binary' : process . env . DARTIUM ,
42
- 'args' : [ '--js-flags=--expose-gc' ] ,
43
- 'perfLoggingPrefs' : {
44
- 'traceCategories' : 'blink.console,disabled-by-default-devtools.timeline'
45
- }
46
- } ,
58
+ chromeOptions : mergeInto ( CHROME_OPTIONS , {
59
+ 'mobileEmulation' : CHROME_MOBILE_EMULATION ,
60
+ 'binary' : process . env . DARTIUM
61
+ } ) ,
47
62
loggingPrefs : {
48
63
performance : 'ALL' ,
49
64
browser : 'ALL'
50
65
}
51
66
} ,
52
67
ChromeDesktop : {
53
68
browserName : 'chrome' ,
54
- chromeOptions : {
55
- 'args' : [ '--js-flags=--expose-gc' ] ,
56
- 'perfLoggingPrefs' : {
57
- 'traceCategories' : 'blink.console,disabled-by-default-devtools.timeline'
58
- }
59
- } ,
69
+ chromeOptions : mergeInto ( CHROME_OPTIONS , {
70
+ 'mobileEmulation' : CHROME_MOBILE_EMULATION
71
+ } ) ,
60
72
loggingPrefs : {
61
73
performance : 'ALL' ,
62
74
browser : 'ALL'
63
75
}
64
76
} ,
65
77
ChromeAndroid : {
66
78
browserName : 'chrome' ,
67
- chromeOptions : {
68
- androidPackage : 'com.android.chrome' ,
69
- 'args' : [ '--js-flags=--expose-gc' ] ,
70
- 'perfLoggingPrefs' : {
71
- 'traceCategories' : 'blink.console,disabled-by-default-devtools.timeline'
72
- }
73
- } ,
79
+ chromeOptions : mergeInto ( CHROME_OPTIONS , {
80
+ 'androidPackage' : 'com.android.chrome' ,
81
+ } ) ,
74
82
loggingPrefs : {
75
83
performance : 'ALL' ,
76
84
browser : 'ALL'
@@ -201,3 +209,10 @@ exports.createBenchpressRunner = function(options) {
201
209
202
210
global . benchpressRunner = new benchpress . Runner ( bindings ) ;
203
211
}
212
+
213
+ function mergeInto ( src , target ) {
214
+ for ( var prop in src ) {
215
+ target [ prop ] = src [ prop ] ;
216
+ }
217
+ return target ;
218
+ }
0 commit comments