| 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..8bc8ed2f6208d682a43bb61e6d6effde90b4e4a9
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettingsTest.cpp
|
| @@ -0,0 +1,28 @@
|
| +// 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(",does not exist, Arial");
|
| + EXPECT_EQ("Arial", settings.standard());
|
| +
|
| + // Otherwise returns any strings as they were set.
|
| + settings.updateStandard("Arial");
|
| + EXPECT_EQ("Arial", settings.standard());
|
| + settings.updateStandard("does not exist");
|
| + EXPECT_EQ("does not exist", settings.standard());
|
| + settings.updateStandard("does not exist, Arial");
|
| + EXPECT_EQ("does not exist, Arial", settings.standard());
|
| +}
|
| +
|
| +} // namespace blink
|
|
|