Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Prepare for utf8.encode() to return more precise Uint8List type #43335

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web_ui/test/canvaskit/fragment_program_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void testMain() {
});

test('FragmentProgram can be created from JSON IPLR bundle', () {
final Uint8List data = utf8.encode(kJsonIPLR) as Uint8List;
final Uint8List data = const Utf8Encoder().convert(kJsonIPLR);
final CkFragmentProgram program = CkFragmentProgram.fromBytes('test', data);

expect(program.effect, isNotNull);
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/engine/channel_buffers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void main() {
}

ByteData _makeByteData(String str) {
final Uint8List list = utf8.encode(str) as Uint8List;
final Uint8List list = const Utf8Encoder().convert(str);
final ByteBuffer buffer = list.buffer;
return ByteData.view(buffer);
}
Expand Down
2 changes: 1 addition & 1 deletion testing/dart/channel_buffers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'dart:ui' as ui;
import 'package:litetest/litetest.dart';

ByteData _makeByteData(String str) {
final Uint8List list = utf8.encode(str) as Uint8List;
final Uint8List list = const Utf8Encoder().convert(str);
final ByteBuffer buffer = list.buffer;
return ByteData.view(buffer);
}
Expand Down