@@ -1245,7 +1245,7 @@ flutter:
1245
1245
.childFile ('GeneratedPluginRegistrant.java' );
1246
1246
1247
1247
expect (registrantFile, exists);
1248
- expect (registrantFile, isNot (contains ('SomePlugin' )));
1248
+ expect (registrantFile. readAsStringSync () , isNot (contains ('SomePlugin' )));
1249
1249
},
1250
1250
overrides: < Type , Generator > {
1251
1251
FileSystem : () => fs,
@@ -1278,7 +1278,7 @@ flutter:
1278
1278
final File registrantFile = iosProject.pluginRegistrantImplementation;
1279
1279
1280
1280
expect (registrantFile, exists);
1281
- expect (registrantFile, isNot (contains ('SomePlugin' )));
1281
+ expect (registrantFile. readAsStringSync () , isNot (contains ('SomePlugin' )));
1282
1282
},
1283
1283
overrides: < Type , Generator > {
1284
1284
FileSystem : () => fs,
@@ -1337,44 +1337,7 @@ flutter:
1337
1337
);
1338
1338
1339
1339
expect (registrantFile, exists);
1340
- expect (registrantFile, isNot (contains ('SomePlugin' )));
1341
- },
1342
- overrides: < Type , Generator > {
1343
- FileSystem : () => fs,
1344
- ProcessManager : () => FakeProcessManager .any (),
1345
- Pub : ThrowingPub .new ,
1346
- },
1347
- );
1348
-
1349
- testUsingContext (
1350
- "pluginClass: none doesn't trigger registrant entry on macOS" ,
1351
- () async {
1352
- flutterProject.isModule = true ;
1353
- // Create a plugin without a pluginClass.
1354
- final Directory pluginDirectory = createFakePlugin (fs);
1355
- pluginDirectory.childFile ('pubspec.yaml' ).writeAsStringSync ('''
1356
- flutter:
1357
- plugin:
1358
- platforms:
1359
- macos:
1360
- pluginClass: none
1361
- dartPluginClass: SomePlugin
1362
- ''' );
1363
- final dependencyManagement = FakeDarwinDependencyManagement ();
1364
- await injectPlugins (
1365
- flutterProject,
1366
- releaseMode: false ,
1367
- macOSPlatform: true ,
1368
- darwinDependencyManagement: dependencyManagement,
1369
- );
1370
-
1371
- final File registrantFile = macosProject.managedDirectory.childFile (
1372
- 'GeneratedPluginRegistrant.swift' ,
1373
- );
1374
-
1375
- expect (registrantFile, exists);
1376
- expect (registrantFile, isNot (contains ('SomePlugin' )));
1377
- expect (registrantFile, isNot (contains ('none' )));
1340
+ expect (registrantFile.readAsStringSync (), isNot (contains ('SomePlugin' )));
1378
1341
},
1379
1342
overrides: < Type , Generator > {
1380
1343
FileSystem : () => fs,
@@ -1593,39 +1556,10 @@ flutter:
1593
1556
);
1594
1557
1595
1558
expect (registrantImpl, exists);
1596
- expect (registrantImpl, isNot (contains ('SomePlugin' )));
1597
- expect (registrantImpl, isNot (contains ('some_plugin' )));
1598
- },
1599
- overrides: < Type , Generator > {
1600
- FileSystem : () => fs,
1601
- ProcessManager : () => FakeProcessManager .any (),
1602
- Pub : ThrowingPub .new ,
1603
- },
1604
- );
1605
-
1606
- testUsingContext (
1607
- "pluginClass: none doesn't trigger registrant entry on Linux" ,
1608
- () async {
1609
- // Create a plugin without a pluginClass.
1610
- final Directory pluginDirectory = createFakePlugin (fs);
1611
- pluginDirectory.childFile ('pubspec.yaml' ).writeAsStringSync ('''
1612
- flutter:
1613
- plugin:
1614
- platforms:
1615
- linux:
1616
- pluginClass: none
1617
- dartPluginClass: SomePlugin
1618
- ''' );
1619
-
1620
- await injectPlugins (flutterProject, releaseMode: false , linuxPlatform: true );
1621
1559
1622
- final File registrantImpl = linuxProject.managedDirectory.childFile (
1623
- 'generated_plugin_registrant.cc' ,
1624
- );
1625
-
1626
- expect (registrantImpl, exists);
1627
- expect (registrantImpl, isNot (contains ('SomePlugin' )));
1628
- expect (registrantImpl, isNot (contains ('none' )));
1560
+ final String contents = registrantImpl.readAsStringSync ();
1561
+ expect (contents, isNot (contains ('SomePlugin' )));
1562
+ expect (contents, isNot (contains ('some_plugin' )));
1629
1563
},
1630
1564
overrides: < Type , Generator > {
1631
1565
FileSystem : () => fs,
@@ -1741,38 +1675,7 @@ flutter:
1741
1675
);
1742
1676
1743
1677
expect (registrantImpl, exists);
1744
- expect (registrantImpl, isNot (contains ('SomePlugin' )));
1745
- },
1746
- overrides: < Type , Generator > {
1747
- FileSystem : () => fs,
1748
- ProcessManager : () => FakeProcessManager .any (),
1749
- Pub : ThrowingPub .new ,
1750
- },
1751
- );
1752
-
1753
- testUsingContext (
1754
- "pluginClass: none doesn't trigger registrant entry on Windows" ,
1755
- () async {
1756
- // Create a plugin without a pluginClass.
1757
- final Directory pluginDirectory = createFakePlugin (fs);
1758
- pluginDirectory.childFile ('pubspec.yaml' ).writeAsStringSync ('''
1759
- flutter:
1760
- plugin:
1761
- platforms:
1762
- windows:
1763
- pluginClass: none
1764
- dartPluginClass: SomePlugin
1765
- ''' );
1766
-
1767
- await injectPlugins (flutterProject, releaseMode: false , windowsPlatform: true );
1768
-
1769
- final File registrantImpl = windowsProject.managedDirectory.childFile (
1770
- 'generated_plugin_registrant.cc' ,
1771
- );
1772
-
1773
- expect (registrantImpl, exists);
1774
- expect (registrantImpl, isNot (contains ('SomePlugin' )));
1775
- expect (registrantImpl, isNot (contains ('none' )));
1678
+ expect (registrantImpl.readAsStringSync (), isNot (contains ('SomePlugin' )));
1776
1679
},
1777
1680
overrides: < Type , Generator > {
1778
1681
FileSystem : () => fs,
0 commit comments