Skip to content

Commit

Permalink
fix binding test
Browse files Browse the repository at this point in the history
  • Loading branch information
xster committed Dec 11, 2020
1 parent eec8d26 commit 3056079
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/flutter/test/services/binding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -44,8 +46,8 @@ class TestBinding extends BindingBase with SchedulerBinding, ServicesBinding {
BinaryMessenger createBinaryMessenger() {
return super.createBinaryMessenger()
..setMockMessageHandler('flutter/assets', (ByteData? message) async {
if (const StringCodec().decodeMessage(message) == 'NOTICES') {
return const StringCodec().encodeMessage(licenses);
if (const StringCodec().decodeMessage(message) == 'NOTICES.gz') {
return Uint8List.fromList(gzip.encode(utf8.encode(licenses))).buffer.asByteData();
}
return null;
});
Expand Down

0 comments on commit 3056079

Please sign in to comment.