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

Unified Diff: content/child/dwrite_font_proxy/font_fallback_win_unittest.cc

Issue 2029343002: Link to DirectWrite directly, instead of calling LoadLibrary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Link content_unittests to dwrite.dll Created 4 years, 6 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: content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
diff --git a/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
index aab440c487200ce48e483ee7fbe61d2ab5cb68e7..2bb8ced29dc38a53bf838c500f8ccbf7573b64df 100644
--- a/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
+++ b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc
@@ -25,7 +25,8 @@ namespace {
class FontFallbackUnitTest : public testing::Test {
public:
FontFallbackUnitTest() {
- CreateDWriteFactory(&factory_);
+ DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory), &factory_);
factory_->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
L"en-us", true /* ignoreUserOverride */,
@@ -47,22 +48,6 @@ class FontFallbackUnitTest : public testing::Test {
&collection_, factory_.Get(), fake_collection_->GetSender());
}
- void CreateDWriteFactory(IUnknown** factory) {
- using DWriteCreateFactoryProc = decltype(DWriteCreateFactory)*;
- HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll");
- if (!dwrite_dll)
- return;
-
- DWriteCreateFactoryProc dwrite_create_factory_proc =
- reinterpret_cast<DWriteCreateFactoryProc>(
- GetProcAddress(dwrite_dll, "DWriteCreateFactory"));
- if (!dwrite_create_factory_proc)
- return;
-
- dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory), factory);
- }
-
scoped_refptr<FakeFontCollection> fake_collection_;
mswr::ComPtr<IDWriteFactory> factory_;
mswr::ComPtr<DWriteFontCollectionProxy> collection_;

Powered by Google App Engine
This is Rietveld 408576698