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; |
11 | 11 |
12 import 'dart:async'; | 12 import 'dart:html'; |
13 import 'package:intl/intl.dart'; | 13 import 'package:unittest/html_config.dart'; |
14 import 'package:intl/date_symbol_data_http_request.dart'; | 14 import 'package:intl/date_symbol_data_http_request.dart'; |
15 import 'date_time_format_test_core.dart'; | 15 import 'date_time_format_test_stub.dart'; |
16 import 'dart:html'; | |
17 import 'package:unittest/unittest.dart'; | |
18 import 'package:unittest/html_config.dart'; | |
19 | |
20 var url = ''; | |
21 | 16 |
22 main() { | 17 main() { |
23 useHtmlConfiguration(); | 18 useHtmlConfiguration(); |
24 url = "http://localhost:${window.location.port}/root_dart/pkg/intl/lib/src/dat
a/dates/"; | 19 var url = "http://localhost:${window.location.port}/root_dart/pkg/intl/lib/src
/data/dates/"; |
25 // Initialize one locale just so we know what the list is. | 20 |
26 test('Run everything', () { | 21 runWith(smallSetOfLocales, url, initializeDateFormatting); |
27 initializeDateFormatting("en_US", url).then(expectAsync1(runEverything));}); | |
28 } | 22 } |
29 | |
30 void runEverything(_) { | |
31 // Initialize all locales and wait for them to finish before running tests. | |
32 var futures = DateFormat.allLocalesWithSymbols() | |
33 .map((locale) => initializeDateFormatting(locale, url)) | |
34 .toList(); | |
35 Future.wait(futures).then(expectAsync1((_) { | |
36 runDateTests(smallSetOfLocales()); | |
37 })); | |
38 } | |
OLD | NEW |