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

Unified Diff: ui/base/webui/web_ui_util_unittest.cc

Issue 2032843002: WebUI: add global "locale" key to loadTimeData in many cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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
« no previous file with comments | « ui/base/webui/web_ui_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/webui/web_ui_util_unittest.cc
diff --git a/ui/base/webui/web_ui_util_unittest.cc b/ui/base/webui/web_ui_util_unittest.cc
index 792895c9b243ea83be29eb10cbc9c43667090a13..90832f1f48ea447a2dbb755383d343815685cf3a 100644
--- a/ui/base/webui/web_ui_util_unittest.cc
+++ b/ui/base/webui/web_ui_util_unittest.cc
@@ -4,6 +4,7 @@
#include "ui/base/webui/web_ui_util.h"
+#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
@@ -52,3 +53,16 @@ TEST(WebUIUtilTest, ParsePathAndScale) {
EXPECT_EQ("random/username/and/more", path);
EXPECT_EQ(1.3f, factor);
}
+
+TEST(WebUIUtilTest, LanguageAndLocale) {
+ base::DictionaryValue defaults;
+ webui::SetLoadTimeDataDefaults("fr-CA", &defaults);
+
+ std::string language;
+ ASSERT_TRUE(defaults.GetString("language", &language));
+ EXPECT_STREQ("fr", language.c_str());
+
+ std::string locale;
+ ASSERT_TRUE(defaults.GetString("locale", &locale));
+ EXPECT_STREQ("fr-CA", locale.c_str());
+}
« no previous file with comments | « ui/base/webui/web_ui_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698