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

Unified Diff: third_party/WebKit/Source/platform/LayoutLocaleTest.cpp

Issue 2161683002: Add LayoutLocale class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test stability Created 4 years, 5 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: third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
diff --git a/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp b/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..08926e7ebab03c80290e731a58b82f875fbd9905
--- /dev/null
+++ b/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/LayoutLocale.h"
+
+#include "platform/Logging.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+TEST(LayoutLocaleTest, Get)
+{
+ LayoutLocale::clearForTesting();
+
+ EXPECT_EQ(nullptr, LayoutLocale::get(nullAtom));
+
+ EXPECT_EQ(emptyAtom, LayoutLocale::get(emptyAtom)->localeString());
+
+ EXPECT_TRUE(equalIgnoringCase("en-us", LayoutLocale::get("en-us")->localeString()));
+ EXPECT_TRUE(equalIgnoringCase("ja-jp", LayoutLocale::get("ja-jp")->localeString()));
+
+ LayoutLocale::clearForTesting();
+}
+
+TEST(LayoutLocaleTest, GetCaseInsensitive)
+{
+ const LayoutLocale* enUS = LayoutLocale::get("en-us");
+ EXPECT_EQ(enUS, LayoutLocale::get("en-US"));
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutLocale.cpp ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698