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

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

Issue 1456873003: More regular Platform implementations in unit tests (reland.) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: have GN disable c4267 also Created 5 years, 1 month 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/fonts/FontCacheTest.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp b/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
index ae6b2c26c946ad249d71ae9e8b2bb97fbed469f1..706f1694702ce6ebb445f6eb92801604d5a7a814 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
@@ -7,19 +7,16 @@
#include "platform/fonts/FontDescription.h"
#include "platform/fonts/SimpleFontData.h"
+#include "platform/testing/TestingPlatformSupport.h"
#include "public/platform/Platform.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
-class EmptyPlatform : public Platform {
+class EmptyPlatform : public TestingPlatformSupport {
public:
EmptyPlatform() {}
~EmptyPlatform() override {}
- void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override
- {
- RELEASE_ASSERT_NOT_REACHED();
- }
};
TEST(FontCache, getLastResortFallbackFont)
@@ -27,9 +24,7 @@ TEST(FontCache, getLastResortFallbackFont)
FontCache* fontCache = FontCache::fontCache();
ASSERT_TRUE(fontCache);
- Platform* oldPlatform = Platform::current();
- OwnPtr<EmptyPlatform> platform = adoptPtr(new EmptyPlatform);
- Platform::initialize(platform.get());
+ EmptyPlatform platform;
FontDescription fontDescription;
fontDescription.setGenericFamily(FontDescription::StandardFamily);
@@ -39,8 +34,6 @@ TEST(FontCache, getLastResortFallbackFont)
fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain);
EXPECT_TRUE(fontData);
-
- Platform::initialize(oldPlatform);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698