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

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

Issue 1464953003: Revert of More regular Platform implementations in unit tests (reland.) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 706f1694702ce6ebb445f6eb92801604d5a7a814..ae6b2c26c946ad249d71ae9e8b2bb97fbed469f1 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp
@@ -7,16 +7,19 @@
#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 TestingPlatformSupport {
+class EmptyPlatform : public Platform {
public:
EmptyPlatform() {}
~EmptyPlatform() override {}
+ void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override
+ {
+ RELEASE_ASSERT_NOT_REACHED();
+ }
};
TEST(FontCache, getLastResortFallbackFont)
@@ -24,7 +27,9 @@
FontCache* fontCache = FontCache::fontCache();
ASSERT_TRUE(fontCache);
- EmptyPlatform platform;
+ Platform* oldPlatform = Platform::current();
+ OwnPtr<EmptyPlatform> platform = adoptPtr(new EmptyPlatform);
+ Platform::initialize(platform.get());
FontDescription fontDescription;
fontDescription.setGenericFamily(FontDescription::StandardFamily);
@@ -34,6 +39,8 @@
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