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

Unified Diff: pkg/intl/test/find_default_locale_standalone_test.dart

Issue 10907266: Find the system locale from the browser or OS (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 side-by-side diff with in-line comments
Download patch
Index: pkg/intl/test/find_default_locale_standalone_test.dart
===================================================================
--- pkg/intl/test/find_default_locale_standalone_test.dart (revision 0)
+++ pkg/intl/test/find_default_locale_standalone_test.dart (revision 0)
@@ -0,0 +1,27 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#library('find_default_locale_browser_test');
+
+#import('../intl.dart');
+#import('../intl_standalone.dart');
+#import('../../unittest/unittest.dart');
+
+main() {
+ test("Find system locale standalone", () {
+ // TODO (alanknight): This only verifies that we found some locale. We
+ // should find a way to force the system locale before the test is run
+ // and then verify that it's actually the correct value.
+ Intl.systemLocale = "xx_YY";
+ var callback = expectAsync1(verifyLocale);
+ findSystemLocale().then(callback);
+ });
+}
+
+verifyLocale(_) {
+ expect(Intl.systemLocale, isNot(equals("xx_YY")));
+ var pattern = new RegExp(@"\w\w_[A-Z0-9]+");
+ var match = pattern.hasMatch(Intl.systemLocale);
+ expect(match, isTrue);
+}
« pkg/intl/intl_standalone.dart ('K') | « pkg/intl/test/find_default_locale_browser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698