Add support for binary compression of dynamic patches by the flutter tool. (#27754)
This reduces the typical dynamic patch size by more than 10x. Also see https://github.com/flutter/engine/pull/7777 for decompression support in the runtime.
This commit is contained in:
committed by
GitHub
parent
8101862bdb
commit
b47da6c2b7
20
packages/flutter_tools/test/base/bsdiff_test.dart
Normal file
20
packages/flutter_tools/test/base/bsdiff_test.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter_tools/src/base/bsdiff.dart';
|
||||
|
||||
import '../src/common.dart';
|
||||
|
||||
void main() {
|
||||
group('Main', () {
|
||||
test('generates diff', () {
|
||||
final Uint8List a = Uint8List.fromList('Hello'.runes.toList());
|
||||
final Uint8List b = Uint8List.fromList('World'.runes.toList());
|
||||
final Uint8List c = Uint8List.fromList(bsdiff(a, b));
|
||||
expect(bspatch(a, c), equals(b));
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user