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

Side by Side Diff: pkg/intl/test/message_extraction/foo_messages_all.dart

Issue 197283043: Avoid flaking in message_extraction tests by doing everything in a temp directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes from review Created 6 years, 9 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
1 /** 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 * DO NOT EDIT. This is code generated via pkg/intl/generate_localized.dart 2 // for details. All rights reserved. Use of this source code is governed by a
3 * This is a library that looks up messages for specific locales by 3 // BSD-style license that can be found in the LICENSE file.
4 * delegating to the appropriate library.
5 */
6 4
7 library messages_all; 5 library keep_the_static_analysis_from_complaining;
8 6
9 import 'dart:async'; 7 initializeMessages(_) => throw new UnimplementedError(
10 import 'package:intl/message_lookup_by_library.dart'; 8 "This entire file is only here to make the static"
11 import 'package:intl/src/intl_helpers.dart'; 9 " analysis happy. It will be generated during actual tests.");
12 import 'package:intl/intl.dart';
13
14 import 'foo_messages_de_DE.dart' as messages_de_DE;
15 import 'foo_messages_fr.dart' as messages_fr;
16
17
18 MessageLookupByLibrary _findExact(localeName) {
19 switch (localeName) {
20 case 'de_DE' : return messages_de_DE.messages;
21 case 'fr' : return messages_fr.messages;
22 default: return null;
23 }
24 }
25
26 /** User programs should call this before using [localeName] for messages.*/
27 Future initializeMessages(String localeName) {
28 initializeInternalMessageLookup(() => new CompositeMessageLookup());
29 messageLookup.addLocale(localeName, _findGeneratedMessagesFor);
30 // TODO(alanknight): Restore once Issue 12824 is fixed.
31 // var lib = deferredLibraries[localeName];
32 // return lib == null ? new Future.value(false) : lib.load();
33 return new Future.value(true);
34 }
35
36 MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
37 var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null,
38 onFailure: (_) => null);
39 if (actualLocale == null) return null;
40 return _findExact(actualLocale);
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698