@@ -2165,17 +2165,19 @@ Future<void> testMain() async {
21652165
21662166 MethodCall setStyle;
21672167
2168+ // Some browsers add spaces after commas in the DOM element's style object.
2169+ // We remove them to match `canonicalizeFontFamily` which doesn't use spaces.
21682170 setStyle = configureSetStyleMethodCall (12 , 'sans-serif' , 4 , 4 , 1 );
21692171 sendFrameworkMessage (codec.encodeMethodCall (setStyle));
2170- expect (input.style.fontFamily, canonicalizeFontFamily ('sans-serif' ));
2172+ expect (input.style.fontFamily. replaceAll ( ', ' , ',' ) , canonicalizeFontFamily ('sans-serif' ));
21712173
21722174 setStyle = configureSetStyleMethodCall (12 , '.SF Pro Text' , 4 , 4 , 1 );
21732175 sendFrameworkMessage (codec.encodeMethodCall (setStyle));
2174- expect (input.style.fontFamily, canonicalizeFontFamily ('.SF Pro Text' ));
2176+ expect (input.style.fontFamily. replaceAll ( ', ' , ',' ) , canonicalizeFontFamily ('.SF Pro Text' ));
21752177
21762178 setStyle = configureSetStyleMethodCall (12 , 'foo bar baz' , 4 , 4 , 1 );
21772179 sendFrameworkMessage (codec.encodeMethodCall (setStyle));
2178- expect (input.style.fontFamily, canonicalizeFontFamily ('foo bar baz' ));
2180+ expect (input.style.fontFamily. replaceAll ( ', ' , ',' ) , canonicalizeFontFamily ('foo bar baz' ));
21792181
21802182 hideKeyboard ();
21812183 });
0 commit comments