From 3331d44f2d587e9e5a2070844be2c98f0df21c45 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 23 Jul 2015 08:39:42 -0700 Subject: [PATCH] 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. --- packages/flutter/example/stocks/lib/stock_data.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/flutter/example/stocks/lib/stock_data.dart b/packages/flutter/example/stocks/lib/stock_data.dart index 5526a9c9cd..7c1e046c21 100644 --- a/packages/flutter/example/stocks/lib/stock_data.dart +++ b/packages/flutter/example/stocks/lib/stock_data.dart @@ -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) {