| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // or details. All rights reserved. Use of this source code is governed by a | 2 // or details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Test date formatting and parsing using locale data read via an http request | 6 * Test date formatting and parsing using locale data read via an http request |
| 7 * to a server. | 7 * to a server. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 library date_time_format_http_request_test; | 10 library date_time_format_http_request_test; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Initialize one locale just so we know what the list is. | 22 // Initialize one locale just so we know what the list is. |
| 23 test('Run everything', () { | 23 test('Run everything', () { |
| 24 initializeDateFormatting("en_US", url).then(expectAsync1(runEverything));}); | 24 initializeDateFormatting("en_US", url).then(expectAsync1(runEverything));}); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void runEverything(_) { | 27 void runEverything(_) { |
| 28 // Initialize all locales and wait for them to finish before running tests. | 28 // Initialize all locales and wait for them to finish before running tests. |
| 29 var futures = DateFormat.allLocalesWithSymbols() | 29 var futures = DateFormat.allLocalesWithSymbols() |
| 30 .mappedBy((locale) => initializeDateFormatting(locale, url)) | 30 .mappedBy((locale) => initializeDateFormatting(locale, url)) |
| 31 .toList(); | 31 .toList(); |
| 32 Futures.wait(futures).then(expectAsync1((_) { | 32 Future.wait(futures).then(expectAsync1((_) { |
| 33 runDateTests(smallSetOfLocales()); | 33 runDateTests(smallSetOfLocales()); |
| 34 shutDown();})); | 34 shutDown();})); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void shutDown() { | 37 void shutDown() { |
| 38 // The tiny web server knows to use this request as a cue to terminate. | 38 // The tiny web server knows to use this request as a cue to terminate. |
| 39 var source = '${url}terminate'; | 39 var source = '${url}terminate'; |
| 40 var request = new HttpRequest.get(source, (_) {}); | 40 var request = new HttpRequest.get(source, (_) {}); |
| 41 } | 41 } |
| OLD | NEW |