@@ -136,7 +136,9 @@ private static String compare(UserAgentDetectionResult a,
136136 addErrorReport (result , "browser version" , a .getBrowser ().getVersion (),
137137 b .getBrowser ().getVersion ());
138138 addErrorReport (result , "browser fullVersion" , a .getBrowser ().getFullVersion (),
139- b .getBrowser ().getFullVersion ());
139+ b .getBrowser ().getFullVersion ());
140+ addErrorReport (result , "browser inWebView" , a .getBrowser ().isInWebView (),
141+ b .getBrowser ().isInWebView ());
140142
141143 addErrorReport (result , "device" , a .getDevice (), b .getDevice ());
142144 addErrorReport (result , "device architecture" , a .getDevice ().getArchitecture (),
@@ -197,11 +199,10 @@ private static void addErrorReport(StringBuilder errors, String name,
197199 .append ("'\n " );
198200 } else {
199201 if (expected != null && actual != null ) {
200- if (expected instanceof String || expected instanceof Enum ) {
202+ if (expected instanceof String || expected instanceof Enum || expected instanceof Boolean ) {
201203 errors .append ("\t expected " ).append (name ).append (" to be '" )
202204 .append (expected .toString ()).append ("' but was '" )
203205 .append (actual .toString ()).append ("'\n " );
204-
205206 }
206207 }
207208 }
@@ -222,7 +223,7 @@ private static class UserAgentDetection {
222223 comment , ignored_tokens , unknown_tokens , device_arch , browser_vendor ,
223224 os_vendor , bot_family , bot_vendor , bot_description , bot_version ,
224225 bot_url , browser_version , browser_fullVersion , re_brand , re_family ,
225- re_version , re_fullversion ;
226+ re_version , re_fullversion , browser_inwebview ;
226227
227228
228229 public UserAgentDetection (String line ) {
@@ -257,6 +258,7 @@ public UserAgentDetection(String line) {
257258 re_family = getStringOrNull (elements [30 ]);
258259 re_version = getStringOrNull (elements [31 ]);
259260 re_fullversion = getStringOrNull (elements [32 ]);
261+ browser_inwebview = getStringOrNull (elements [33 ]);
260262 }
261263
262264 private String getStringOrNull (String s ) {
@@ -274,7 +276,7 @@ public UserAgentDetectionResult getDetectionResult() {
274276 bot_description , bot_version , bot_url );
275277 }
276278
277- return new UserAgentDetectionResult (
279+ UserAgentDetectionResult res = new UserAgentDetectionResult (
278280 new Device (device_arch , Enum .valueOf (DeviceType .class , device_type ),
279281 Enum .valueOf (Brand .class , device_brand ), Enum .valueOf (
280282 Brand .class , device_manufacturer ), device ),
@@ -291,7 +293,8 @@ public UserAgentDetectionResult getDetectionResult() {
291293 OSFamily .class , os_family ), os_description , os_version ),
292294 new Locale (lang , country ), comment , ignored_tokens , unknown_tokens ,
293295 bot );
294-
296+ res .getBrowser ().setInWebView (browser_inwebview .equals ("1" ));
297+ return res ;
295298 }
296299 }
297300}
0 commit comments