Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion packages/network_info_plus_watchos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
* Example: the start test checks a start without an error, and then the
network info, which waits for the location prompt: it is skipped on a
fresh install with no one to answer the prompt, unless the run passes
`--dart-define=NIP_PROMPT=true`.
`--dart-define=NIP_PROMPT=true`. The wait for the network info is timed
apart from the 3-second startup check, so it keeps its full 10 seconds
(a minute while someone answers the prompt).

## 0.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void main() {
await Permission.locationWhenInUse.status != PermissionStatus.denied;

app.main();
final Stopwatch elapsed = Stopwatch()..start();
while (elapsed.elapsed < const Duration(seconds: 3)) {
final Stopwatch startup = Stopwatch()..start();
while (startup.elapsed < const Duration(seconds: 3)) {
await tester.pump(const Duration(milliseconds: 100));
}
expect(tester.takeException(), isNull);
Expand All @@ -55,11 +55,13 @@ void main() {
return;
}

// The info arrives after the answer and seven native reads.
// The info arrives after the answer and seven native reads. The wait is
// timed on its own, so the startup pump above does not shorten it.
final Duration limit =
answered ? const Duration(seconds: 10) : const Duration(seconds: 60);
final Finder info = find.textContaining('Wifi IPv4:');
while (info.evaluate().isEmpty && elapsed.elapsed < limit) {
final Stopwatch waited = Stopwatch()..start();
while (info.evaluate().isEmpty && waited.elapsed < limit) {
await tester.pump(const Duration(milliseconds: 100));
}

Expand Down
Loading