Skip to content

Commit

Permalink
[web] Make 'Noto Color Emoji' opt-in (flutter#40990)
Browse files Browse the repository at this point in the history
[web] Make 'Noto Color Emoji' opt-in
  • Loading branch information
mdebbar authored and zhongwuzw committed Apr 14, 2023
1 parent e4616b1 commit c7ac4f7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 6 deletions.
8 changes: 8 additions & 0 deletions lib/web_ui/dev/generate_fallback_font_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,18 @@ class GenerateFallbackFontDataCommand extends Command<bool>
sb.writeln();
sb.writeln('// DO NOT EDIT! This file is generated. See:');
sb.writeln('// dev/generate_fallback_font_data.dart');
sb.writeln("import '../configuration.dart';");
sb.writeln("import 'noto_font.dart';");
sb.writeln();
sb.writeln('final List<NotoFont> fallbackFonts = <NotoFont>[');

for (final String family in fallbackFonts) {
if (family == 'Noto Emoji') {
sb.write(' if (!configuration.useColorEmoji)');
}
if (family == 'Noto Color Emoji') {
sb.write(' if (configuration.useColorEmoji)');
}
sb.writeln(" NotoFont('$family', '${urlForFamily[family]!}',");
final List<String> starts = <String>[];
final List<String> ends = <String>[];
Expand Down Expand Up @@ -166,6 +173,7 @@ class GenerateFallbackFontDataCommand extends Command<bool>
const List<String> fallbackFonts = <String>[
'Noto Sans',
'Noto Color Emoji',
'Noto Emoji',
'Noto Sans Symbols',
'Noto Sans Symbols 2',
'Noto Sans Adlam',
Expand Down
8 changes: 7 additions & 1 deletion lib/web_ui/lib/src/engine/canvaskit/font_fallback_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// DO NOT EDIT! This file is generated. See:
// dev/generate_fallback_font_data.dart
import '../configuration.dart';
import 'noto_font.dart';

final List<NotoFont> fallbackFonts = <NotoFont>[
Expand All @@ -12,11 +13,16 @@ final List<NotoFont> fallbackFonts = <NotoFont>[
// <int>[0x7e,0x377,0x37f,0x38a,0x38c,0x3a1,0x3e1,0x52f,0x97f,0x1ac0,0x1c88,0x1cf6,0x1cf9,0x1df9,0x1f15,0x1f1d,0x1f45,0x1f4d,0x1f57,0x1f59,0x1f5b,0x1f5d,0x1f7d,0x1fb4,0x1fc4,0x1fd3,0x1fdb,0x1fef,0x1ff4,0x1ffe,0x2064,0x2071,0x208e,0x209c,0x20bf,0x20f0,0x215f,0x2184,0x2189,0x2212,0x2215,0x25cc,0x2c7f,0x2e52,0xa69f,0xa7bf,0xa7ca,0xa7ff,0xa839,0xa8ff,0xa92e,0xab6b,0xfb06,0xfe00,0xfe2f,0xfeff,0xfffd,]
'w|2m;4g|k7;oq|5;p0|6;p8|;pa|j;pv|1q;s0|8v;1s0|3j;59s|g;5mo|8;5ow|12;5q0|1;5q8|6x;5x7|7u;654|5;65c|11;66g|5;66o|7;66x|;66z|;671|;673|u;680|1g;69i|e;69y|d;6ae|5;6al|i;6b6|2;6ba|8;6bk|2s;6ee|b;6es|q;6fk|c;6g0|v;6i8|;6io|2n;6mc|;6mh|;6qa|;6qd|;7gs|;8rk|v;928|36;wu8|2n;wzk|5b;x4y|8;x6d|a;x80|9;xcw|v;xf2|;xtc|1n;1dkw|6;1e68|;1e74|f;1edb|;1ekc|1;',
),
NotoFont('Noto Color Emoji', 'https://fonts.gstatic.com/s/notocoloremoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFab5s79iz64w.ttf',
if (configuration.useColorEmoji) NotoFont('Noto Color Emoji', 'https://fonts.gstatic.com/s/notocoloremoji/v24/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFab5s79iz64w.ttf',
// <int>[0x20,0x23,0x2a,0x30,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2194,0x21a9,0x231a,0x2328,0x23cf,0x23e9,0x23f8,0x24c2,0x25aa,0x25b6,0x25c0,0x25fb,0x2600,0x260e,0x2611,0x2614,0x2618,0x261d,0x2620,0x2622,0x2626,0x262a,0x262e,0x2638,0x2640,0x2642,0x2648,0x265f,0x2663,0x2665,0x2668,0x267b,0x267e,0x2692,0x2699,0x269b,0x26a0,0x26a7,0x26aa,0x26b0,0x26bd,0x26c4,0x26c8,0x26ce,0x26d1,0x26d3,0x26e9,0x26f0,0x26f7,0x26fd,0x2702,0x2705,0x2708,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2733,0x2744,0x2747,0x274c,0x274e,0x2753,0x2757,0x2763,0x2795,0x27a1,0x27b0,0x27bf,0x2934,0x2b05,0x2b1b,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0x1f004,0x1f0cf,0x1f170,0x1f17e,0x1f18e,0x1f191,0x1f1e6,0x1f201,0x1f21a,0x1f22f,0x1f232,0x1f250,0x1f300,0x1f324,0x1f396,0x1f399,0x1f39e,0x1f3f3,0x1f3f7,0x1f4ff,0x1f549,0x1f550,0x1f56f,0x1f573,0x1f587,0x1f58a,0x1f590,0x1f595,0x1f5a4,0x1f5a8,0x1f5b1,0x1f5bc,0x1f5c2,0x1f5d1,0x1f5dc,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f5fa,0x1f680,0x1f6cb,0x1f6d5,0x1f6dc,0x1f6e9,0x1f6eb,0x1f6f0,0x1f6f3,0x1f7e0,0x1f7f0,0x1f90c,0x1f93c,0x1f947,0x1fa70,0x1fa80,0x1fa90,0x1fabf,0x1face,0x1fae0,0x1faf0,0xe0030,0xe0061,0xe007f,0xfe4e5,0xfe82c,0xfe82e,],
// <int>[0x20,0x23,0x2a,0x39,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2199,0x21aa,0x231b,0x2328,0x23cf,0x23f3,0x23fa,0x24c2,0x25ab,0x25b6,0x25c0,0x25fe,0x2604,0x260e,0x2611,0x2615,0x2618,0x261d,0x2620,0x2623,0x2626,0x262a,0x262f,0x263a,0x2640,0x2642,0x2653,0x2660,0x2663,0x2666,0x2668,0x267b,0x267f,0x2697,0x2699,0x269c,0x26a1,0x26a7,0x26ab,0x26b1,0x26be,0x26c5,0x26c8,0x26cf,0x26d1,0x26d4,0x26ea,0x26f5,0x26fa,0x26fd,0x2702,0x2705,0x270d,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2734,0x2744,0x2747,0x274c,0x274e,0x2755,0x2757,0x2764,0x2797,0x27a1,0x27b0,0x27bf,0x2935,0x2b07,0x2b1c,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0x1f004,0x1f0cf,0x1f171,0x1f17f,0x1f18e,0x1f19a,0x1f1ff,0x1f202,0x1f21a,0x1f22f,0x1f23a,0x1f251,0x1f321,0x1f393,0x1f397,0x1f39b,0x1f3f0,0x1f3f5,0x1f4fd,0x1f53d,0x1f54e,0x1f567,0x1f570,0x1f57a,0x1f587,0x1f58d,0x1f590,0x1f596,0x1f5a5,0x1f5a8,0x1f5b2,0x1f5bc,0x1f5c4,0x1f5d3,0x1f5de,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f64f,0x1f6c5,0x1f6d2,0x1f6d7,0x1f6e5,0x1f6e9,0x1f6ec,0x1f6f0,0x1f6fc,0x1f7eb,0x1f7f0,0x1f93a,0x1f945,0x1f9ff,0x1fa7c,0x1fa88,0x1fabd,0x1fac5,0x1fadb,0x1fae8,0x1faf8,0xe0039,0xe007a,0xe007f,0xfe4ee,0xfe82c,0xfe837,]
'w|;z|;16|;1c|9;4p|;4u|;6bx|;6d8|;6dl|;6hv|;6jm|;6k9|;6ms|5;6nd|1;6xm|1;6y0|;72n|;73d|a;73s|2;79e|;7fu|1;7g6|;7gg|;7i3|3;7i8|4;7im|;7ip|;7is|1;7iw|;7j1|;7j4|;7j6|1;7ja|;7je|;7ji|1;7js|2;7k0|;7k2|;7k8|b;7kv|1;7kz|;7l1|1;7l4|;7ln|;7lq|1;7ma|5;7mh|;7mj|1;7mo|1;7mv|;7my|1;7n4|1;7nh|1;7no|1;7ns|;7ny|1;7o1|;7o3|1;7op|1;7ow|5;7p3|3;7p9|;7pe|;7ph|;7pk|5;7pr|;7pu|;7pw|;7py|;7q5|;7q9|;7qg|;7qr|1;7r8|;7rb|;7rg|;7ri|;7rn|2;7rr|;7s3|1;7th|2;7tt|;7u8|;7un|;850|1;8hx|2;8ij|1;8k0|;8k5|;9io|;9j1|;9zr|;9zt|;2pz8|;2q4v|;2q9c|1;2q9q|1;2qa6|;2qa9|9;2qcm|p;2qdd|1;2qe2|;2qen|;2qeq|8;2qfk|1;2qkg|x;2qlg|33;2qom|1;2qop|2;2qou|2a;2qr7|2;2qrb|7a;2qyn|1q;2r0p|5;2r0w|n;2r1r|1;2r1v|7;2r2f|;2r2i|3;2r2o|;2r2t|1;2r38|1;2r3c|;2r3l|1;2r3w|;2r42|2;2r4h|2;2r4s|2;2r4x|;2r4z|;2r54|;2r5b|;2r5f|;2r5m|2d;2r9c|1x;2rbf|7;2rbp|2;2rbw|9;2rc9|;2rcb|1;2rcg|;2rcj|9;2rj4|b;2rjk|;2rrg|1a;2rss|9;2rt3|54;2s1c|c;2s1s|8;2s28|19;2s3j|6;2s3y|d;2s4g|8;2s4w|8;jnzk|9;jo0x|p;jo1r|;mbqd|9;mcdo|;mcdq|9;',
),
if (!configuration.useColorEmoji) NotoFont('Noto Emoji', 'https://fonts.gstatic.com/s/notoemoji/v34/bMrnmSyK7YY-MEu6aWjPDs-ar6uWaGWuob-r0jwvS-FGJCMY.ttf',
// <int>[0x20,0x23,0x2a,0x30,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2194,0x21a9,0x231a,0x2328,0x23cf,0x23e9,0x23f8,0x24c2,0x25aa,0x25b6,0x25c0,0x25fb,0x2600,0x260e,0x2611,0x2614,0x2618,0x261d,0x2620,0x2622,0x2626,0x262a,0x262e,0x2638,0x2640,0x2642,0x2648,0x265f,0x2663,0x2665,0x2668,0x267b,0x267e,0x2692,0x2699,0x269b,0x26a0,0x26a7,0x26aa,0x26b0,0x26bd,0x26c4,0x26c8,0x26ce,0x26d1,0x26d3,0x26e9,0x26f0,0x26f7,0x26fd,0x2702,0x2705,0x2708,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2733,0x2744,0x2747,0x274c,0x274e,0x2753,0x2757,0x2763,0x2795,0x27a1,0x27b0,0x27bf,0x2934,0x2b05,0x2b1b,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0xfe0e,0x1f004,0x1f0cf,0x1f170,0x1f17e,0x1f18e,0x1f191,0x1f1e6,0x1f201,0x1f21a,0x1f22f,0x1f232,0x1f250,0x1f300,0x1f324,0x1f396,0x1f399,0x1f39e,0x1f3f3,0x1f3f7,0x1f4ff,0x1f549,0x1f550,0x1f56f,0x1f573,0x1f587,0x1f58a,0x1f590,0x1f595,0x1f5a4,0x1f5a8,0x1f5b1,0x1f5bc,0x1f5c2,0x1f5d1,0x1f5dc,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f5fa,0x1f680,0x1f6cb,0x1f6d5,0x1f6dc,0x1f6e9,0x1f6eb,0x1f6f0,0x1f6f3,0x1f7e0,0x1f7f0,0x1f90c,0x1f93c,0x1f947,0x1fa70,0x1fa80,0x1fa90,0x1fabf,0x1face,0x1fae0,0x1faf0,0xe0030,0xe0061,0xe007f,0xfe4e5,0xfe82c,0xfe82e,],
// <int>[0x20,0x23,0x2a,0x39,0xa9,0xae,0x200d,0x203c,0x2049,0x20e3,0x2122,0x2139,0x2199,0x21aa,0x231b,0x2328,0x23cf,0x23f3,0x23fa,0x24c2,0x25ab,0x25b6,0x25c0,0x25fe,0x2604,0x260e,0x2611,0x2615,0x2618,0x261d,0x2620,0x2623,0x2626,0x262a,0x262f,0x263a,0x2640,0x2642,0x2653,0x2660,0x2663,0x2666,0x2668,0x267b,0x267f,0x2697,0x2699,0x269c,0x26a1,0x26a7,0x26ab,0x26b1,0x26be,0x26c5,0x26c8,0x26cf,0x26d1,0x26d4,0x26ea,0x26f5,0x26fa,0x26fd,0x2702,0x2705,0x270d,0x270f,0x2712,0x2714,0x2716,0x271d,0x2721,0x2728,0x2734,0x2744,0x2747,0x274c,0x274e,0x2755,0x2757,0x2764,0x2797,0x27a1,0x27b0,0x27bf,0x2935,0x2b07,0x2b1c,0x2b50,0x2b55,0x3030,0x303d,0x3297,0x3299,0xfe0f,0x1f004,0x1f0cf,0x1f171,0x1f17f,0x1f18e,0x1f19a,0x1f1ff,0x1f202,0x1f21a,0x1f22f,0x1f23a,0x1f251,0x1f321,0x1f393,0x1f397,0x1f39b,0x1f3f0,0x1f3f5,0x1f4fd,0x1f53d,0x1f54e,0x1f567,0x1f570,0x1f57a,0x1f587,0x1f58d,0x1f590,0x1f596,0x1f5a5,0x1f5a8,0x1f5b2,0x1f5bc,0x1f5c4,0x1f5d3,0x1f5de,0x1f5e1,0x1f5e3,0x1f5e8,0x1f5ef,0x1f5f3,0x1f64f,0x1f6c5,0x1f6d2,0x1f6d7,0x1f6e5,0x1f6e9,0x1f6ec,0x1f6f0,0x1f6fc,0x1f7eb,0x1f7f0,0x1f93a,0x1f945,0x1f9ff,0x1fa7c,0x1fa88,0x1fabd,0x1fac5,0x1fadb,0x1fae8,0x1faf8,0xe0039,0xe007a,0xe007f,0xfe4ee,0xfe82c,0xfe837,]
'w|;z|;16|;1c|9;4p|;4u|;6bx|;6d8|;6dl|;6hv|;6jm|;6k9|;6ms|5;6nd|1;6xm|1;6y0|;72n|;73d|a;73s|2;79e|;7fu|1;7g6|;7gg|;7i3|3;7i8|4;7im|;7ip|;7is|1;7iw|;7j1|;7j4|;7j6|1;7ja|;7je|;7ji|1;7js|2;7k0|;7k2|;7k8|b;7kv|1;7kz|;7l1|1;7l4|;7ln|;7lq|1;7ma|5;7mh|;7mj|1;7mo|1;7mv|;7my|1;7n4|1;7nh|1;7no|1;7ns|;7ny|1;7o1|;7o3|1;7op|1;7ow|5;7p3|3;7p9|;7pe|;7ph|;7pk|5;7pr|;7pu|;7pw|;7py|;7q5|;7q9|;7qg|;7qr|1;7r8|;7rb|;7rg|;7ri|;7rn|2;7rr|;7s3|1;7th|2;7tt|;7u8|;7un|;850|1;8hx|2;8ij|1;8k0|;8k5|;9io|;9j1|;9zr|;9zt|;1e6m|1;2pz8|;2q4v|;2q9c|1;2q9q|1;2qa6|;2qa9|9;2qcm|p;2qdd|1;2qe2|;2qen|;2qeq|8;2qfk|1;2qkg|x;2qlg|33;2qom|1;2qop|2;2qou|2a;2qr7|2;2qrb|7a;2qyn|1q;2r0p|5;2r0w|n;2r1r|1;2r1v|7;2r2f|;2r2i|3;2r2o|;2r2t|1;2r38|1;2r3c|;2r3l|1;2r3w|;2r42|2;2r4h|2;2r4s|2;2r4x|;2r4z|;2r54|;2r5b|;2r5f|;2r5m|2d;2r9c|1x;2rbf|7;2rbp|2;2rbw|9;2rc9|;2rcb|1;2rcg|;2rcj|9;2rj4|b;2rjk|;2rrg|1a;2rss|9;2rt3|54;2s1c|c;2s1s|8;2s28|19;2s3j|6;2s3y|d;2s4g|8;2s4w|8;jnzk|9;jo0x|p;jo1r|;mbqd|9;mcdo|;mcdq|9;',
),
NotoFont('Noto Sans Symbols', 'https://fonts.gstatic.com/s/notosanssymbols/v40/rP2up3q65FkAtHfwd-eIS2brbDN6gxP34F9jRRCe4W3gfQ8gavVFRkzrbQ.ttf',
// <int>[0x20,0xa0,0xa5,0xa7,0xae,0xb4,0xb6,0xba,0xbf,0x10a,0x116,0x11e,0x126,0x12a,0x12e,0x136,0x139,0x141,0x14a,0x150,0x15e,0x164,0x16a,0x1cd,0x218,0x237,0x2c6,0x2c9,0x2d8,0x300,0x306,0x30a,0x312,0x326,0x1e80,0x1e9e,0x1ef2,0x2013,0x2018,0x201c,0x2022,0x2026,0x2039,0x20ac,0x20dd,0x20e2,0x2122,0x2160,0x2185,0x218a,0x2190,0x2212,0x2300,0x2311,0x2317,0x231c,0x2322,0x2329,0x232c,0x237c,0x2380,0x2396,0x23af,0x23be,0x23d0,0x23e2,0x2460,0x25cc,0x260a,0x2613,0x2624,0x2638,0x263d,0x2669,0x2690,0x26a2,0x26ad,0x26ce,0x26e2,0x271d,0x2776,0x2921,0x1f100,0x1f110,0x1f170,0x1f19b,0x1f546,0x1f54f,0x1f610,0x1f700,],
// <int>[0x7e,0xa3,0xa5,0xab,0xb0,0xb4,0xb8,0xbb,0x107,0x113,0x11b,0x123,0x127,0x12b,0x133,0x137,0x13e,0x148,0x14d,0x15b,0x161,0x165,0x17e,0x1ce,0x21b,0x237,0x2c7,0x2c9,0x2dd,0x304,0x308,0x30c,0x312,0x328,0x1e85,0x1e9e,0x1ef3,0x2014,0x201a,0x201e,0x2022,0x2026,0x203a,0x20ac,0x20e0,0x20e4,0x2122,0x2183,0x2188,0x218b,0x2199,0x2212,0x230f,0x2315,0x2317,0x231f,0x2323,0x232a,0x2335,0x237c,0x2394,0x239a,0x23af,0x23cd,0x23db,0x23e8,0x24ff,0x25cc,0x260d,0x2613,0x262f,0x263b,0x2653,0x267e,0x269d,0x26a9,0x26bc,0x26ce,0x26ff,0x2721,0x2793,0x2922,0x1f10c,0x1f16c,0x1f190,0x1f1ac,0x1f549,0x1f54f,0x1f610,0x1f773,]
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/canvaskit/font_fallbacks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class FontFallbackData {
registeredFallbackFonts.add(RegisteredFont(bytes, family, typeface));
// Insert emoji font before all other fallback fonts so we use the emoji
// whenever it's available.
if (family == 'Noto Color Emoji') {
if (family == 'Noto Color Emoji' || family == 'Noto Emoji') {
if (globalFontFallbacks.first == 'Roboto') {
globalFontFallbacks.insert(1, family);
} else {
Expand Down
10 changes: 10 additions & 0 deletions lib/web_ui/lib/src/engine/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ class FlutterConfiguration {
///
/// This is used by the Renderer class to decide how to initialize the engine.
String? get requestedRendererType => _configuration?.renderer ?? _requestedRendererType;

/// Whether to use color emojis or not.
///
/// The font used to render color emojis is large (~24MB). This configuration
/// gives developers the ability to decide for their app.
bool get useColorEmoji => _configuration?.useColorEmoji ?? false;
}

@JS('window.flutterConfiguration')
Expand Down Expand Up @@ -317,6 +323,10 @@ extension JsFlutterConfigurationExtension on JsFlutterConfiguration {
@JS('renderer')
external JSString? get _renderer;
String? get renderer => _renderer?.toDart;

@JS('useColorEmoji')
external JSBoolean? get _useColorEmoji;
bool? get useColorEmoji => _useColorEmoji?.toDart;
}

/// A JavaScript entrypoint that allows developer to set rendering backend
Expand Down
8 changes: 4 additions & 4 deletions lib/web_ui/test/canvaskit/fallback_fonts_golden_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void testMain() {
.singleWhere((NotoFont font) => font.name == 'Noto Sans Arabic')
.url;
final String notoEmojiUrl = fallbackFonts
.singleWhere((NotoFont font) => font.name == 'Noto Color Emoji')
.singleWhere((NotoFont font) => font.name == 'Noto Emoji')
.url;
TestDownloader.mockDownloads[notoSansArabicUrl] =
'/assets/fonts/NotoNaskhArabic-Regular.ttf';
Expand Down Expand Up @@ -123,7 +123,7 @@ void testMain() {

expect(FontFallbackData.instance.globalFontFallbacks, <String>[
'Roboto',
'Noto Color Emoji',
'Noto Emoji',
'Noto Sans Arabic',
]);
});
Expand All @@ -144,7 +144,7 @@ void testMain() {
await notoDownloadQueue.debugWhenIdle();

expect(FontFallbackData.instance.globalFontFallbacks,
contains('Noto Color Emoji'));
contains('Noto Emoji'));

final CkPictureRecorder recorder = CkPictureRecorder();
final CkCanvas canvas = recorder.beginRecording(kDefaultRegion);
Expand Down Expand Up @@ -250,7 +250,7 @@ void testMain() {
testedFonts,
unorderedEquals(<String>{
'Noto Sans',
'Noto Color Emoji',
'Noto Emoji',
'Noto Sans Symbols',
'Noto Sans Symbols 2',
'Noto Sans Adlam',
Expand Down
18 changes: 18 additions & 0 deletions lib/web_ui/test/engine/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,22 @@ void testMain() {
expect(config.canvasKitVariant, CanvasKitVariant.chromium);
});
});

group('useColorEmoji', () {
test('defaults to false', () {
final FlutterConfiguration config = FlutterConfiguration();
config.setUserConfiguration(
js_util.jsify(<String, Object?>{}) as JsFlutterConfiguration,
);
expect(config.useColorEmoji, isFalse);
});

test('can be set to true', () {
final FlutterConfiguration config = FlutterConfiguration();
config.setUserConfiguration(
js_util.jsify(<String, Object?>{'useColorEmoji': true}) as JsFlutterConfiguration,
);
expect(config.useColorEmoji, isTrue);
});
});
}

0 comments on commit c7ac4f7

Please sign in to comment.