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

Side by Side Diff: content/common/font_warmup_win_unittest.cc

Issue 1363643003: Fix more clang/win plugin warnings after GDI font emulation CL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/font_warmup_win.h" 5 #include "content/common/font_warmup_win.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 const char* kTestFontFamily = "GDITest"; 126 const char* kTestFontFamily = "GDITest";
127 const wchar_t* kTestFontFamilyW = L"GDITest"; 127 const wchar_t* kTestFontFamilyW = L"GDITest";
128 const SkFontTableTag kTestFontTableTag = 0x11223344; 128 const SkFontTableTag kTestFontTableTag = 0x11223344;
129 const char* kTestFontData = "GDITestGDITest"; 129 const char* kTestFontData = "GDITestGDITest";
130 const wchar_t* kTestFontFamilyInvalid = L"InvalidFont"; 130 const wchar_t* kTestFontFamilyInvalid = L"InvalidFont";
131 131
132 class TestSkFontMgr : public SkFontMgr { 132 class TestSkFontMgr : public SkFontMgr {
133 public: 133 public:
134 TestSkFontMgr() { content::SetPreSandboxWarmupFontMgrForTesting(this); } 134 TestSkFontMgr() { content::SetPreSandboxWarmupFontMgrForTesting(this); }
135 ~TestSkFontMgr() { content::SetPreSandboxWarmupFontMgrForTesting(nullptr); } 135 ~TestSkFontMgr() override {
136 content::SetPreSandboxWarmupFontMgrForTesting(nullptr);
137 }
136 138
137 protected: 139 protected:
138 int onCountFamilies() const override { return 1; } 140 int onCountFamilies() const override { return 1; }
139 141
140 void onGetFamilyName(int index, SkString* familyName) const override { 142 void onGetFamilyName(int index, SkString* familyName) const override {
141 if (index == 0) 143 if (index == 0)
142 *familyName = kTestFontFamily; 144 *familyName = kTestFontFamily;
143 } 145 }
144 146
145 SkFontStyleSet* onCreateStyleSet(int index) const override { 147 SkFontStyleSet* onCreateStyleSet(int index) const override {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); 423 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData));
422 std::vector<char> data(data_size); 424 std::vector<char> data(data_size);
423 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); 425 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size());
424 EXPECT_EQ(size, data_size); 426 EXPECT_EQ(size, data_size);
425 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); 427 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0);
426 EXPECT_TRUE(DeleteObject(font)); 428 EXPECT_TRUE(DeleteObject(font));
427 EXPECT_TRUE(DeleteDC(hdc)); 429 EXPECT_TRUE(DeleteDC(hdc));
428 } 430 }
429 431
430 } // namespace content 432 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698