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

Unified Diff: third_party/WebKit/Source/platform/fonts/GenericFontFamilySettingsTest.cpp

Issue 2441343003: Allow the default generic font family settings to find the first available font (Closed)
Patch Set: msw review Created 4 years, 2 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 | « third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp ('k') | ui/gfx/font_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/GenericFontFamilySettingsTest.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettingsTest.cpp b/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettingsTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d67073b6c9274f160fa8d20e99483078b49967ee
--- /dev/null
+++ b/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettingsTest.cpp
@@ -0,0 +1,29 @@
+// 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/fonts/GenericFontFamilySettings.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+TEST(GenericFontFamilySettingsTest, FirstAvailableFontFamily) {
+ GenericFontFamilySettings settings;
+ EXPECT_TRUE(settings.standard().isEmpty());
+
+ // Returns the first available font if starts with ",".
+ settings.updateStandard(",not exist, Arial");
+ EXPECT_EQ("Arial", settings.standard());
+
+ // Otherwise returns any strings as they were set.
+ AtomicString nonLists[] = {
+ "Arial", "not exist", "not exist, Arial",
+ };
+ for (const AtomicString& name : nonLists) {
+ settings.updateStandard(name);
+ EXPECT_EQ(name, settings.standard());
+ }
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp ('k') | ui/gfx/font_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698