Commit 90c4c84
committed
api tests: Have FakeHttpClient.send enqueue response handling in a new task
The Future returned by FakeHttpClient.send is created with either
Future.value or Future.error, which means it'll complete in a
*microtask*:
https://web.archive.org/web/20170704074724/https://webdev.dartlang.org/articles/performance/event-loop#event-queue-new-future
That's too soon, as a simulation for a real API response coming over
an HTTP connection. In the live code that this simulates, the Future
completes in a new task. So, mimic that behavior.1 parent 32927ff commit 90c4c84
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
0 commit comments