testWidgets('Update inherited when removing node',(WidgetTestertester)async{
testWidgetsWithLeakTracking('Update inherited when removing node',(WidgetTestertester)async{
finalList<String>log=<String>[];
finalList<String>log=<String>[];
awaittester.pumpWidget(
awaittester.pumpWidget(
...
@@ -166,7 +167,7 @@ void main() {
...
@@ -166,7 +167,7 @@ void main() {
log.clear();
log.clear();
});
});
testWidgets('Update inherited when removing node and child has global key',(WidgetTestertester)async{
testWidgetsWithLeakTracking('Update inherited when removing node and child has global key',(WidgetTestertester)async{
finalList<String>log=<String>[];
finalList<String>log=<String>[];
...
@@ -230,7 +231,7 @@ void main() {
...
@@ -230,7 +231,7 @@ void main() {
log.clear();
log.clear();
});
});
testWidgets('Update inherited when removing node and child has global key with constant child',(WidgetTestertester)async{
testWidgetsWithLeakTracking('Update inherited when removing node and child has global key with constant child',(WidgetTestertester)async{
finalList<int>log=<int>[];
finalList<int>log=<int>[];
finalKeykey=GlobalKey();
finalKeykey=GlobalKey();
...
@@ -289,7 +290,7 @@ void main() {
...
@@ -289,7 +290,7 @@ void main() {
log.clear();
log.clear();
});
});
testWidgets('Update inherited when removing node and child has global key with constant child, minimised',(WidgetTestertester)async{
testWidgetsWithLeakTracking('Update inherited when removing node and child has global key with constant child, minimised',(WidgetTestertester)async{
finalList<int>log=<int>[];
finalList<int>log=<int>[];
...
@@ -336,7 +337,7 @@ void main() {
...
@@ -336,7 +337,7 @@ void main() {
log.clear();
log.clear();
});
});
testWidgets('Inherited widget notifies descendants when descendant previously failed to find a match',(WidgetTestertester)async{
testWidgetsWithLeakTracking('Inherited widget notifies descendants when descendant previously failed to find a match',(WidgetTestertester)async{
int?inheritedValue=-1;
int?inheritedValue=-1;
finalWidgetinner=Container(
finalWidgetinner=Container(
...
@@ -365,7 +366,7 @@ void main() {
...
@@ -365,7 +366,7 @@ void main() {
expect(inheritedValue,equals(3));
expect(inheritedValue,equals(3));
});
});
testWidgets("Inherited widget doesn't notify descendants when descendant did not previously fail to find a match and had no dependencies",(WidgetTestertester)async{
testWidgetsWithLeakTracking("Inherited widget doesn't notify descendants when descendant did not previously fail to find a match and had no dependencies",(WidgetTestertester)async{
intbuildCount=0;
intbuildCount=0;
finalWidgetinner=Container(
finalWidgetinner=Container(
...
@@ -392,7 +393,7 @@ void main() {
...
@@ -392,7 +393,7 @@ void main() {
expect(buildCount,equals(1));
expect(buildCount,equals(1));
});
});
testWidgets('Inherited widget does notify descendants when descendant did not previously fail to find a match but did have other dependencies',(WidgetTestertester)async{
testWidgetsWithLeakTracking('Inherited widget does notify descendants when descendant did not previously fail to find a match but did have other dependencies',(WidgetTestertester)async{
intbuildCount=0;
intbuildCount=0;
finalWidgetinner=Container(
finalWidgetinner=Container(
...
@@ -423,10 +424,11 @@ void main() {
...
@@ -423,10 +424,11 @@ void main() {
expect(buildCount,equals(2));
expect(buildCount,equals(2));
});
});
testWidgets("BuildContext.getInheritedWidgetOfExactType doesn't create a dependency",(WidgetTestertester)async{
testWidgetsWithLeakTracking("BuildContext.getInheritedWidgetOfExactType doesn't create a dependency",(WidgetTestertester)async{
intbuildCount=0;
intbuildCount=0;
finalGlobalKey<void>inheritedKey=GlobalKey();
finalGlobalKey<void>inheritedKey=GlobalKey();
finalChangeNotifiernotifier=ChangeNotifier();
finalChangeNotifiernotifier=ChangeNotifier();
addTearDown(notifier.dispose);
finalWidgetbuilder=Builder(
finalWidgetbuilder=Builder(
builder:(BuildContextcontext){
builder:(BuildContextcontext){
...
@@ -449,7 +451,7 @@ void main() {
...
@@ -449,7 +451,7 @@ void main() {
expect(buildCount,equals(1));
expect(buildCount,equals(1));
});
});
testWidgets('initState() dependency on Inherited asserts',(WidgetTestertester)async{
testWidgetsWithLeakTracking('initState() dependency on Inherited asserts',(WidgetTestertester)async{
// This is a regression test for https://github.com/flutter/flutter/issues/5491
// This is a regression test for https://github.com/flutter/flutter/issues/5491