Commit fde816f 1 parent f6a7a2a commit fde816f Copy full SHA for fde816f
File tree 2 files changed +15
-9
lines changed
2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -253,16 +253,18 @@ export class WebOSDriver extends BaseDriver {
253
253
254
254
/**
255
255
* Set chrome version v63.0.3239.0 as the minimal version
256
- * for autodownload to use proper chromedriver version.
257
- * Older than the chromedriver version could raise no Chrome binary found error,
258
- * which no makes sense for TV automation usage.
256
+ * for autodownload to use proper chromedriver version if
257
+ * - the 'Browser' info does not have proper chrome version, or
258
+ * - older than the chromedriver version could raise no Chrome binary found error,
259
+ * which no makes sense for TV automation usage.
259
260
*
260
261
* @param {BrowserVersionInfo } browserVersionInfo
261
262
* @return {BrowserVersionInfo }
262
263
*/
263
264
fixChromeVersionForAutodownload ( browserVersionInfo ) {
264
265
const chromeVersion = VERSION_PATTERN . exec ( browserVersionInfo . Browser ?? '' ) ;
265
266
if ( ! chromeVersion ) {
267
+ browserVersionInfo . Browser = MIN_CHROME_VERSION ;
266
268
return browserVersionInfo ;
267
269
}
268
270
@@ -307,6 +309,7 @@ export class WebOSDriver extends BaseDriver {
307
309
log . info ( `The response of http://${ debuggerAddress } /json/version was ${ JSON . stringify ( result ) } ` ) ;
308
310
result = this . useUAForBrowserIfNotPresent ( result ) ;
309
311
result = this . fixChromeVersionForAutodownload ( result ) ;
312
+ log . info ( `Fixed browser info is ${ JSON . stringify ( result ) } ` ) ;
310
313
311
314
// To respect the executableDir.
312
315
executable = undefined ;
Original file line number Diff line number Diff line change @@ -139,13 +139,16 @@ describe('WebOSDriver', function () {
139
139
const driver = new WebOSDriver ( ) ;
140
140
const browserInfo = {
141
141
'Browser' : '' ,
142
- 'Protocol-Version' : '1.3' ,
143
- 'User-Agent' : 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' ,
144
- 'V8-Version' : '8.7.220.(29*1000 + 2)' ,
145
- 'WebKit-Version' : '537.36 (@cec52f3dd4465dd7389298b97ab723856c556bd)' ,
146
- 'webSocketDebuggerUrl' : 'ws://192.168.0.1:9998/devtools/browser/a4b3786c-2d2f-4751-9e05-aee2023bc226'
142
+ 'Protocol-Version' : '1.1' ,
143
+ 'User-Agent' : '' ,
144
+ 'WebKit-Version' : '537.36 (@fa89da905405aab455e0f0d4ec7f49631c7ca70b)'
147
145
} ;
148
- driver . fixChromeVersionForAutodownload ( browserInfo ) . should . eql ( browserInfo ) ;
146
+ driver . fixChromeVersionForAutodownload ( browserInfo ) . should . eql ( {
147
+ 'Browser' : 'Chrome/63.0.3239.0' ,
148
+ 'Protocol-Version' : '1.1' ,
149
+ 'User-Agent' : '' ,
150
+ 'WebKit-Version' : '537.36 (@fa89da905405aab455e0f0d4ec7f49631c7ca70b)'
151
+ } ) ;
149
152
} ) ;
150
153
151
154
it ( 'Use the given chrome version' , function ( ) {
You can’t perform that action at this time.
0 commit comments