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 7bc539bc073fae895b108c276e7601a1df466dd7..b5faca2bcc0128949cf4cf549b6f1e95ba20ef01 100644 |
--- a/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc |
+++ b/content/child/dwrite_font_proxy/font_fallback_win_unittest.cc |
@@ -25,8 +25,7 @@ |
class FontFallbackUnitTest : public testing::Test { |
public: |
FontFallbackUnitTest() { |
- DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), |
- &factory_); |
+ CreateDWriteFactory(&factory_); |
factory_->CreateNumberSubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, |
L"en-us", true /* ignoreUserOverride */, |
@@ -48,6 +47,22 @@ |
&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_; |