asset_bundle_package_test.dart 21.2 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4 5 6 7 8
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';
import 'dart:convert';

import 'package:file/file.dart';
9
import 'package:file/memory.dart';
10

11 12
import 'package:flutter_tools/src/asset.dart';
import 'package:flutter_tools/src/base/file_system.dart';
13
import 'package:flutter_tools/src/base/platform.dart';
14 15
import 'package:flutter_tools/src/cache.dart';

16 17 18
import '../src/common.dart';
import '../src/context.dart';
import '../src/pubspec_schema.dart';
19 20

void main() {
21 22 23 24 25 26 27 28
  String fixPath(String path) {
    // The in-memory file system is strict about slashes on Windows being the
    // correct way so until https://github.com/google/file.dart/issues/112 is
    // fixed we fix them here.
    // TODO(dantup): Remove this function once the above issue is fixed and
    // rolls into Flutter.
    return path?.replaceAll('/', fs.path.separator);
  }
29
  void writePubspecFile(String path, String name, { List<String> assets }) {
30 31 32 33
    String assetsSection;
    if (assets == null) {
      assetsSection = '';
    } else {
34
      final StringBuffer buffer = StringBuffer();
35 36 37 38 39 40 41 42 43 44 45 46 47
      buffer.write('''
flutter:
     assets:
''');

      for (String asset in assets) {
        buffer.write('''
       - $asset
''');
      }
      assetsSection = buffer.toString();
    }

48
    fs.file(fixPath(path))
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
      ..createSync(recursive: true)
      ..writeAsStringSync('''
name: $name
dependencies:
  flutter:
    sdk: flutter
$assetsSection
''');
  }

  void establishFlutterRoot() {
    Cache.flutterRoot = getFlutterRoot();
  }

  void writePackagesFile(String packages) {
64
    fs.file('.packages')
65 66 67 68
      ..createSync()
      ..writeAsStringSync(packages);
  }

69
  Future<void> buildAndVerifyAssets(
70 71 72 73
    List<String> assets,
    List<String> packages,
    String expectedAssetManifest,
  ) async {
74
    final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
75 76 77 78
    await bundle.build(manifestPath: 'pubspec.yaml');

    for (String packageName in packages) {
      for (String asset in assets) {
79
        final String entryKey = Uri.encodeFull('packages/$packageName/$asset');
80
        expect(bundle.entries.containsKey(entryKey), true, reason: 'Cannot find key on bundle: $entryKey');
81
        expect(
82
          utf8.decode(await bundle.entries[entryKey].contentsAsBytes()),
83 84 85 86 87 88
          asset,
        );
      }
    }

    expect(
89
      utf8.decode(await bundle.entries['AssetManifest.json'].contentsAsBytes()),
90 91 92 93 94 95
      expectedAssetManifest,
    );
  }

  void writeAssets(String path, List<String> assets) {
    for (String asset in assets) {
96
      final String fullPath = fixPath(fs.path.join(path, asset));
97

98
      fs.file(fullPath)
99 100 101 102 103
        ..createSync(recursive: true)
        ..writeAsStringSync(asset);
    }
  }

104
  FileSystem testFileSystem;
105 106

  setUp(() async {
107
    testFileSystem = MemoryFileSystem(
108 109 110 111 112
      style: platform.isWindows
        ? FileSystemStyle.windows
        : FileSystemStyle.posix,
    );
    testFileSystem.currentDirectory = testFileSystem.systemTempDirectory.createTempSync('flutter_asset_bundle_test.');
113 114
  });

115 116
  group('AssetBundle assets from packages', () {
    testUsingContext('No assets are bundled when the package has no assets', () async {
117
      establishFlutterRoot();
118
      writeEmptySchemaFile(fs);
119 120 121 122 123

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');
      writePubspecFile('p/p/pubspec.yaml', 'test_package');

124
      final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
125
      await bundle.build(manifestPath: 'pubspec.yaml');
126
      expect(bundle.entries.length, 3); // LICENSE, AssetManifest, FontManifest
127
      const String expectedAssetManifest = '{}';
128
      expect(
129
        utf8.decode(await bundle.entries['AssetManifest.json'].contentsAsBytes()),
130 131
        expectedAssetManifest,
      );
132
      expect(
133
        utf8.decode(await bundle.entries['FontManifest.json'].contentsAsBytes()),
134 135
        '[]',
      );
136 137
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
138
      ProcessManager: () => FakeProcessManager.any(),
139
    });
140

141 142
    testUsingContext('No assets are bundled when the package has an asset that is not listed', () async {
      establishFlutterRoot();
143
      writeEmptySchemaFile(fs);
144 145 146 147 148 149 150 151

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');
      writePubspecFile('p/p/pubspec.yaml', 'test_package');

      final List<String> assets = <String>['a/foo'];
      writeAssets('p/p/', assets);

152
      final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
153
      await bundle.build(manifestPath: 'pubspec.yaml');
154
      expect(bundle.entries.length, 3); // LICENSE, AssetManifest, FontManifest
155
      const String expectedAssetManifest = '{}';
156
      expect(
157
        utf8.decode(await bundle.entries['AssetManifest.json'].contentsAsBytes()),
158 159
        expectedAssetManifest,
      );
160
      expect(
161
        utf8.decode(await bundle.entries['FontManifest.json'].contentsAsBytes()),
162 163
        '[]',
      );
164 165
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
166
      ProcessManager: () => FakeProcessManager.any(),
167
    });
168 169

    testUsingContext('One asset is bundled when the package has and lists one asset its pubspec', () async {
170
      establishFlutterRoot();
171
      writeEmptySchemaFile(fs);
172 173 174 175 176 177 178 179 180 181 182 183 184

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assets = <String>['a/foo'];
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assets,
      );

      writeAssets('p/p/', assets);

185
      const String expectedAssetManifest = '{"packages/test_package/a/foo":'
186 187 188 189 190 191
          '["packages/test_package/a/foo"]}';
      await buildAndVerifyAssets(
        assets,
        <String>['test_package'],
        expectedAssetManifest,
      );
192 193
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
194
      ProcessManager: () => FakeProcessManager.any(),
195
    });
196

197
    testUsingContext("One asset is bundled when the package has one asset, listed in the app's pubspec", () async {
198
      establishFlutterRoot();
199
      writeEmptySchemaFile(fs);
200 201 202 203 204 205 206 207 208 209 210 211 212

      final List<String> assetEntries = <String>['packages/test_package/a/foo'];
      writePubspecFile(
        'pubspec.yaml',
        'test',
        assets: assetEntries,
      );
      writePackagesFile('test_package:p/p/lib/');
      writePubspecFile('p/p/pubspec.yaml', 'test_package');

      final List<String> assets = <String>['a/foo'];
      writeAssets('p/p/lib/', assets);

213
      const String expectedAssetManifest = '{"packages/test_package/a/foo":'
214 215 216 217 218 219
          '["packages/test_package/a/foo"]}';
      await buildAndVerifyAssets(
        assets,
        <String>['test_package'],
        expectedAssetManifest,
      );
220 221
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
222
      ProcessManager: () => FakeProcessManager.any(),
223
    });
224

225
    testUsingContext('One asset and its variant are bundled when the package has an asset and a variant, and lists the asset in its pubspec', () async {
226
      establishFlutterRoot();
227
      writeEmptySchemaFile(fs);
228 229 230 231 232 233 234 235 236 237 238 239

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: <String>['a/foo'],
      );

      final List<String> assets = <String>['a/foo', 'a/v/foo'];
      writeAssets('p/p/', assets);

240
      const String expectedManifest = '{"packages/test_package/a/foo":'
241 242 243 244 245 246 247
          '["packages/test_package/a/foo","packages/test_package/a/v/foo"]}';

      await buildAndVerifyAssets(
        assets,
        <String>['test_package'],
        expectedManifest,
      );
248 249
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
250
      ProcessManager: () => FakeProcessManager.any(),
251
    });
252

253
    testUsingContext('One asset and its variant are bundled when the package has an asset and a variant, and the app lists the asset in its pubspec', () async {
254
      establishFlutterRoot();
255
      writeEmptySchemaFile(fs);
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270

      writePubspecFile(
        'pubspec.yaml',
        'test',
        assets: <String>['packages/test_package/a/foo'],
      );
      writePackagesFile('test_package:p/p/lib/');
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
      );

      final List<String> assets = <String>['a/foo', 'a/v/foo'];
      writeAssets('p/p/lib/', assets);

271
      const String expectedManifest = '{"packages/test_package/a/foo":'
272 273 274 275 276 277 278
          '["packages/test_package/a/foo","packages/test_package/a/v/foo"]}';

      await buildAndVerifyAssets(
        assets,
        <String>['test_package'],
        expectedManifest,
      );
279 280
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
281
      ProcessManager: () => FakeProcessManager.any(),
282
    });
283

284
    testUsingContext('Two assets are bundled when the package has and lists two assets in its pubspec', () async {
285
      establishFlutterRoot();
286
      writeEmptySchemaFile(fs);
287 288 289 290 291 292 293 294 295 296 297 298

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assets = <String>['a/foo', 'a/bar'];
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assets,
      );

      writeAssets('p/p/', assets);
299
      const String expectedAssetManifest =
300 301
          '{"packages/test_package/a/bar":["packages/test_package/a/bar"],'
          '"packages/test_package/a/foo":["packages/test_package/a/foo"]}';
302 303 304 305 306 307

      await buildAndVerifyAssets(
        assets,
        <String>['test_package'],
        expectedAssetManifest,
      );
308 309
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
310
      ProcessManager: () => FakeProcessManager.any(),
311
    });
312

313
    testUsingContext("Two assets are bundled when the package has two assets, listed in the app's pubspec", () async {
314
      establishFlutterRoot();
315
      writeEmptySchemaFile(fs);
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334

      final List<String> assetEntries = <String>[
        'packages/test_package/a/foo',
        'packages/test_package/a/bar',
      ];
      writePubspecFile(
        'pubspec.yaml',
        'test',
         assets: assetEntries,
      );
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assets = <String>['a/foo', 'a/bar'];
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
      );

      writeAssets('p/p/lib/', assets);
335
      const String expectedAssetManifest =
336 337
          '{"packages/test_package/a/bar":["packages/test_package/a/bar"],'
          '"packages/test_package/a/foo":["packages/test_package/a/foo"]}';
338 339 340 341 342 343

      await buildAndVerifyAssets(
        assets,
        <String>['test_package'],
        expectedAssetManifest,
      );
344 345
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
346
      ProcessManager: () => FakeProcessManager.any(),
347
    });
348

349
    testUsingContext('Two assets are bundled when two packages each have and list an asset their pubspec', () async {
350
      establishFlutterRoot();
351
      writeEmptySchemaFile(fs);
352

353 354 355 356
      writePubspecFile(
        'pubspec.yaml',
        'test',
      );
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
      writePackagesFile('test_package:p/p/lib/\ntest_package2:p2/p/lib/');
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: <String>['a/foo'],
      );
      writePubspecFile(
        'p2/p/pubspec.yaml',
        'test_package2',
        assets: <String>['a/foo'],
      );

      final List<String> assets = <String>['a/foo', 'a/v/foo'];
      writeAssets('p/p/', assets);
      writeAssets('p2/p/', assets);

373
      const String expectedAssetManifest =
374 375 376 377 378 379 380 381 382 383
          '{"packages/test_package/a/foo":'
          '["packages/test_package/a/foo","packages/test_package/a/v/foo"],'
          '"packages/test_package2/a/foo":'
          '["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}';

      await buildAndVerifyAssets(
        assets,
        <String>['test_package', 'test_package2'],
        expectedAssetManifest,
      );
384 385
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
386
      ProcessManager: () => FakeProcessManager.any(),
387
    });
388

389
    testUsingContext("Two assets are bundled when two packages each have an asset, listed in the app's pubspec", () async {
390
      establishFlutterRoot();
391
      writeEmptySchemaFile(fs);
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415

      final List<String> assetEntries = <String>[
        'packages/test_package/a/foo',
        'packages/test_package2/a/foo',
      ];
      writePubspecFile(
        'pubspec.yaml',
        'test',
        assets: assetEntries,
      );
      writePackagesFile('test_package:p/p/lib/\ntest_package2:p2/p/lib/');
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
      );
      writePubspecFile(
        'p2/p/pubspec.yaml',
        'test_package2',
      );

      final List<String> assets = <String>['a/foo', 'a/v/foo'];
      writeAssets('p/p/lib/', assets);
      writeAssets('p2/p/lib/', assets);

416
      const String expectedAssetManifest =
417 418 419 420 421 422 423 424 425 426
          '{"packages/test_package/a/foo":'
          '["packages/test_package/a/foo","packages/test_package/a/v/foo"],'
          '"packages/test_package2/a/foo":'
          '["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}';

      await buildAndVerifyAssets(
        assets,
        <String>['test_package', 'test_package2'],
        expectedAssetManifest,
      );
427 428
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
429
      ProcessManager: () => FakeProcessManager.any(),
430
    });
431

432
    testUsingContext('One asset is bundled when the app depends on a package, listing in its pubspec an asset from another package', () async {
433
      establishFlutterRoot();
434
      writeEmptySchemaFile(fs);
435 436 437 438 439 440 441 442
      writePubspecFile(
        'pubspec.yaml',
        'test',
      );
      writePackagesFile('test_package:p/p/lib/\ntest_package2:p2/p/lib/');
      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
443
        assets: <String>['packages/test_package2/a/foo'],
444 445 446 447 448 449 450 451 452
      );
      writePubspecFile(
        'p2/p/pubspec.yaml',
        'test_package2',
      );

      final List<String> assets = <String>['a/foo', 'a/v/foo'];
      writeAssets('p2/p/lib/', assets);

453
      const String expectedAssetManifest =
454 455 456 457 458 459 460 461
          '{"packages/test_package2/a/foo":'
          '["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}';

      await buildAndVerifyAssets(
        assets,
        <String>['test_package2'],
        expectedAssetManifest,
      );
462 463
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
464
      ProcessManager: () => FakeProcessManager.any(),
465
    });
466
  });
467 468 469

  testUsingContext('Asset paths can contain URL reserved characters', () async {
    establishFlutterRoot();
470
    writeEmptySchemaFile(fs);
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491

    writePubspecFile('pubspec.yaml', 'test');
    writePackagesFile('test_package:p/p/lib/');

    final List<String> assets = <String>['a/foo', 'a/foo[x]'];
    writePubspecFile(
      'p/p/pubspec.yaml',
      'test_package',
      assets: assets,
    );

    writeAssets('p/p/', assets);
    const String expectedAssetManifest =
        '{"packages/test_package/a/foo":["packages/test_package/a/foo"],'
        '"packages/test_package/a/foo%5Bx%5D":["packages/test_package/a/foo%5Bx%5D"]}';

    await buildAndVerifyAssets(
      assets,
      <String>['test_package'],
      expectedAssetManifest,
    );
492 493
  }, overrides: <Type, Generator>{
    FileSystem: () => testFileSystem,
494
      ProcessManager: () => FakeProcessManager.any(),
495
  });
496 497

  group('AssetBundle assets from scanned paths', () {
498
    testUsingContext('Two assets are bundled when scanning their directory', () async {
499
      establishFlutterRoot();
500
      writeEmptySchemaFile(fs);
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assetsOnDisk = <String>['a/foo', 'a/bar'];
      final List<String> assetsOnManifest = <String>['a/'];

      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assetsOnManifest,
      );

      writeAssets('p/p/', assetsOnDisk);
      const String expectedAssetManifest =
          '{"packages/test_package/a/bar":["packages/test_package/a/bar"],'
          '"packages/test_package/a/foo":["packages/test_package/a/foo"]}';

      await buildAndVerifyAssets(
        assetsOnDisk,
        <String>['test_package'],
        expectedAssetManifest,
      );
524 525
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
526
      ProcessManager: () => FakeProcessManager.any(),
527 528
    });

529
    testUsingContext('Two assets are bundled when listing one and scanning second directory', () async {
530
      establishFlutterRoot();
531
      writeEmptySchemaFile(fs);
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assetsOnDisk = <String>['a/foo', 'abc/bar'];
      final List<String> assetOnManifest = <String>['a/foo', 'abc/'];

      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assetOnManifest,
      );

      writeAssets('p/p/', assetsOnDisk);
      const String expectedAssetManifest =
          '{"packages/test_package/abc/bar":["packages/test_package/abc/bar"],'
          '"packages/test_package/a/foo":["packages/test_package/a/foo"]}';

      await buildAndVerifyAssets(
        assetsOnDisk,
        <String>['test_package'],
        expectedAssetManifest,
      );
555 556
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
557
      ProcessManager: () => FakeProcessManager.any(),
558 559
    });

560
    testUsingContext('One asset is bundled with variant, scanning wrong directory', () async {
561
      establishFlutterRoot();
562
      writeEmptySchemaFile(fs);
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assetsOnDisk = <String>['a/foo','a/b/foo','a/bar'];
      final List<String> assetOnManifest = <String>['a','a/bar']; // can't list 'a' as asset, should be 'a/'

      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assetOnManifest,
      );

      writeAssets('p/p/', assetsOnDisk);

      final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
      await bundle.build(manifestPath: 'pubspec.yaml');
      assert(bundle.entries['AssetManifest.json'] == null,'Invalid pubspec.yaml should not generate AssetManifest.json'  );
581 582
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
583
      ProcessManager: () => FakeProcessManager.any(),
584 585 586 587
    });
  });

  group('AssetBundle assets from scanned paths with MemoryFileSystem', () {
588
    testUsingContext('One asset is bundled with variant, scanning directory', () async {
589
      establishFlutterRoot();
590
      writeEmptySchemaFile(fs);
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assetsOnDisk = <String>['a/foo','a/b/foo'];
      final List<String> assetOnManifest = <String>['a/',];

      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assetOnManifest,
      );

      writeAssets('p/p/', assetsOnDisk);
      const String expectedAssetManifest =
          '{"packages/test_package/a/foo":["packages/test_package/a/foo","packages/test_package/a/b/foo"]}';

      await buildAndVerifyAssets(
        assetsOnDisk,
        <String>['test_package'],
        expectedAssetManifest,
      );
613 614
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
615
      ProcessManager: () => FakeProcessManager.any(),
616 617
    });

618
    testUsingContext('No asset is bundled with variant, no assets or directories are listed', () async {
619
      establishFlutterRoot();
620
      writeEmptySchemaFile(fs);
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assetsOnDisk = <String>['a/foo', 'a/b/foo'];
      final List<String> assetOnManifest = <String>[];

      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assetOnManifest,
      );

      writeAssets('p/p/', assetsOnDisk);
      const String expectedAssetManifest = '{}';

      await buildAndVerifyAssets(
        assetOnManifest,
        <String>['test_package'],
        expectedAssetManifest,
      );
642 643
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
644
      ProcessManager: () => FakeProcessManager.any(),
645 646
    });

647
    testUsingContext('Expect error generating manifest, wrong non-existing directory is listed', () async {
648
      establishFlutterRoot();
649
      writeEmptySchemaFile(fs);
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675

      writePubspecFile('pubspec.yaml', 'test');
      writePackagesFile('test_package:p/p/lib/');

      final List<String> assetOnManifest = <String>['c/'];

      writePubspecFile(
        'p/p/pubspec.yaml',
        'test_package',
        assets: assetOnManifest,
      );

      try {
        await buildAndVerifyAssets(
          assetOnManifest,
          <String>['test_package'],
          null,
        );

        final Function watchdog = () async {
          assert(false, 'Code failed to detect missing directory. Test failed.');
        };
        watchdog();
      } catch (e) {
        // Test successful
      }
676 677
    }, overrides: <Type, Generator>{
      FileSystem: () => testFileSystem,
678
      ProcessManager: () => FakeProcessManager.any(),
679 680 681
    });

  });
682
}