| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/webui/options/font_settings_utils.h" | |
| 6 | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 | |
| 9 namespace options { | |
| 10 | |
| 11 TEST(FontSettingsUtilitiesTest, ResolveFontList) { | |
| 12 EXPECT_TRUE(FontSettingsUtilities::ResolveFontList("").empty()); | |
| 13 | |
| 14 // Returns the first available font if starts with ",". | |
| 15 EXPECT_EQ("Arial", | |
| 16 FontSettingsUtilities::ResolveFontList(",not exist, Arial")); | |
| 17 | |
| 18 // Returns the first font if no fonts are available. | |
| 19 EXPECT_EQ("not exist", | |
| 20 FontSettingsUtilities::ResolveFontList(",not exist, not exist 2")); | |
| 21 | |
| 22 // Otherwise returns any strings as they were set. | |
| 23 std::string non_lists[] = { | |
| 24 "Arial", "not exist", "not exist, Arial", | |
| 25 }; | |
| 26 for (const std::string& name : non_lists) | |
| 27 EXPECT_EQ(name, FontSettingsUtilities::ResolveFontList(name)); | |
| 28 } | |
| 29 | |
| 30 } // namespace options | |
| OLD | NEW |