Don't try to access the network in Stocks test

Accessing the network created a race condition that would sometimes cause other
tests to fail.
This commit is contained in:
Adam Barth
2015-07-23 08:39:42 -07:00
parent 3d41fb8a89
commit 3331d44f2d

View File

@@ -62,11 +62,15 @@ class StockDataFetcher {
int _nextChunk = 0;
final StockDataCallback callback;
static bool actuallyFetchData = true;
StockDataFetcher(this.callback) {
_fetchNextChunk();
}
void _fetchNextChunk() {
if (!actuallyFetchData)
return;
fetchBody(_urlToFetch(_nextChunk++)).then((Response response) {
String json = response.bodyAsString();
if (json == null) {