Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[url_launcher_web] Added stress test of creation and disposing of Lin…
…k widgets.
  • Loading branch information
kristoffer-zliide authored and ditman committed Jun 14, 2022
commit 89a3ad4c1cfeddaad88e06bfcd596268afcbb8bf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,36 @@ void main() {
final html.Element anchor = _findSingleAnchor();
expect(anchor.hasAttribute('href'), false);
});

testWidgets('can be created and disposed', (WidgetTester tester) async {
final Uri uri = Uri.parse('http://foobar');
const int itemCount = 500;
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: MediaQuery(
data: const MediaQueryData(),
child: ListView.builder(
itemCount: itemCount,
itemBuilder: (_, int index) => WebLinkDelegate(TestLinkInfo(
uri: uri,
target: LinkTarget.defaultTarget,
builder: (BuildContext context, FollowLink? followLink) =>
Text('#$index', textAlign: TextAlign.center),
)),
),
),
),
);

await tester.pumpAndSettle();

await tester.scrollUntilVisible(
find.text('#${itemCount - 1}'),
2500,
maxScrolls: 1000,
);
});
});
}

Expand Down