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

Unified Diff: chrome/browser/ui/webui/options/font_settings_utils_unittest.cc

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
Index: chrome/browser/ui/webui/options/font_settings_utils_unittest.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_utils_unittest.cc b/chrome/browser/ui/webui/options/font_settings_utils_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2c274d1029da3943f5d2fffc3c7b599f98dd7ad9
--- /dev/null
+++ b/chrome/browser/ui/webui/options/font_settings_utils_unittest.cc
@@ -0,0 +1,30 @@
+// 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 "chrome/browser/ui/webui/options/font_settings_utils.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace options {
+
+TEST(FontSettingsUtilitiesTest, ResolveFontList) {
+ EXPECT_TRUE(FontSettingsUtilities::ResolveFontList("").empty());
+
+ // Returns the first available font if starts with ",".
+ EXPECT_EQ("Arial",
+ FontSettingsUtilities::ResolveFontList(",not exist, Arial"));
+
+ // Returns the first font if no fonts are available.
+ EXPECT_EQ("not exist",
+ FontSettingsUtilities::ResolveFontList(",not exist, not exist 2"));
+
+ // Otherwise returns any strings as they were set.
+ std::string non_lists[] = {
+ "Arial", "not exist", "not exist, Arial",
+ };
+ for (const std::string& name : non_lists)
+ EXPECT_EQ(name, FontSettingsUtilities::ResolveFontList(name));
+}
+
+} // namespace options
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_utils.cc ('k') | chrome/browser/ui/webui/options/font_settings_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698