Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: pkg/intl/test/date_time_format_http_request_test.dart

Issue 10959002: Read locales over http in the browser (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * Test date formatting and parsing using locale data read via an http request
7 * to a server.
8 */
9
10 // TODO(alanknight): It would be nice if there were a more general facility
11 // than this and it could be replaced, possibly the things Graham is working on.
12 // The following magical comments will cause the test code run via test.py
13 // to add an extra command starting up a web server that will serve the
14 // files we are looking for.
15 // ExtraCommand=dart
16 // ExtraCommandArgs=pkg/intl/test/start_web_server.dart
17 #library('date_time_format_http_request_test');
18
19 #import('../lib/date_format.dart');
20 #import('../lib/date_symbol_data_http_request.dart');
21 #import('date_time_format_test_core.dart');
22 #import('dart:html');
23
24 var url = "http://localhost:8000/dates/";
25
26 main() {
27 // Initialize one locale just so we know what the list is.
28 initializeDateFormatting("en_US", url).then(runEverything);
29 }
30
31 void runEverything(_) {
32 // Initialize all locales and wait for them to finish before running tests.
33 var futures = DateFormat.allLocalesWithSymbols().map(
34 (locale) => initializeDateFormatting(locale, url));
35 Futures.wait(futures).then((results) {
36 runDateTests();
37 shutDown();});
38 }
39
40 void shutDown() {
41 // The tiny web server knows to use this request as a cue to terminate.
42 var source = '$url/terminate';
43 var request = new HttpRequest.get(source, (_) {});
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698