Index: content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc |
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc |
index 88c02eeb003f64e21ef5408df90af2784824c6c6..fe97f483e42af62e77ef81bd9b78695a0cc55adf 100644 |
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc |
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc |
@@ -24,27 +24,9 @@ namespace content { |
namespace { |
-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); |
-} |
- |
class DWriteFontProxyUnitTest : public testing::Test { |
public: |
DWriteFontProxyUnitTest() { |
- if (!factory) |
scottmg
2016/06/28 23:22:45
Were all these early outs because the dll wasn't l
Ilya Kulshin
2016/06/28 23:42:50
These were there because we still needed XP and Vi
|
- return; |
fake_collection_ = new FakeFontCollection(); |
SetupFonts(fake_collection_.get()); |
mswr::MakeAndInitialize<DWriteFontCollectionProxy>( |
@@ -71,7 +53,8 @@ class DWriteFontProxyUnitTest : public testing::Test { |
} |
static void SetUpTestCase() { |
- CreateDWriteFactory(&factory); |
+ DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), |
+ &factory); |
std::vector<base::char16> font_path; |
font_path.resize(MAX_PATH); |
@@ -96,9 +79,6 @@ std::vector<base::string16> DWriteFontProxyUnitTest::arial_font_files; |
mswr::ComPtr<IDWriteFactory> DWriteFontProxyUnitTest::factory; |
TEST_F(DWriteFontProxyUnitTest, GetFontFamilyCount) { |
- if (!factory) |
- return; |
- |
UINT32 family_count = collection_->GetFontFamilyCount(); |
EXPECT_EQ(3u, family_count); |
@@ -114,8 +94,6 @@ TEST_F(DWriteFontProxyUnitTest, GetFontFamilyCount) { |
TEST_F(DWriteFontProxyUnitTest, FindFamilyNameShouldFindFamily) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -133,8 +111,6 @@ TEST_F(DWriteFontProxyUnitTest, FindFamilyNameShouldFindFamily) { |
TEST_F(DWriteFontProxyUnitTest, FindFamilyNameShouldReturnUINTMAXWhenNotFound) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -150,8 +126,6 @@ TEST_F(DWriteFontProxyUnitTest, FindFamilyNameShouldReturnUINTMAXWhenNotFound) { |
TEST_F(DWriteFontProxyUnitTest, FindFamilyNameShouldNotSendDuplicateIPC) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -167,8 +141,6 @@ TEST_F(DWriteFontProxyUnitTest, FindFamilyNameShouldNotSendDuplicateIPC) { |
TEST_F(DWriteFontProxyUnitTest, GetFontFamilyShouldCreateFamily) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -214,8 +186,6 @@ void CheckLocale(const base::string16& locale_name, |
TEST_F(DWriteFontProxyUnitTest, GetFamilyNames) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -253,8 +223,6 @@ TEST_F(DWriteFontProxyUnitTest, GetFamilyNames) { |
TEST_F(DWriteFontProxyUnitTest, GetFontCollection) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -275,8 +243,6 @@ TEST_F(DWriteFontProxyUnitTest, GetFontCollection) { |
TEST_F(DWriteFontProxyUnitTest, GetFamilyNamesShouldNotIPCAfterLoadingFamily) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -295,8 +261,6 @@ TEST_F(DWriteFontProxyUnitTest, GetFamilyNamesShouldNotIPCAfterLoadingFamily) { |
TEST_F(DWriteFontProxyUnitTest, |
GetFontFamilyShouldNotCreateFamilyWhenIndexIsInvalid) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -312,8 +276,6 @@ TEST_F(DWriteFontProxyUnitTest, |
TEST_F(DWriteFontProxyUnitTest, LoadingFontFamily) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |
@@ -348,8 +310,6 @@ TEST_F(DWriteFontProxyUnitTest, LoadingFontFamily) { |
TEST_F(DWriteFontProxyUnitTest, GetFontFromFontFaceShouldFindFont) { |
HRESULT hr; |
- if (!factory) |
- return; |
UINT32 index = UINT_MAX; |
BOOL exists = FALSE; |