OLD | NEW |
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/child/font_warmup_win.h" | 5 #include "content/child/font_warmup_win.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/sys_byteorder.h" | 15 #include "base/sys_byteorder.h" |
16 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
17 #include "skia/ext/refptr.h" | |
18 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "third_party/skia/include/core/SkString.h" | 18 #include "third_party/skia/include/core/SkString.h" |
20 #include "third_party/skia/include/core/SkTypeface.h" | 19 #include "third_party/skia/include/core/SkTypeface.h" |
21 #include "third_party/skia/include/ports/SkFontMgr.h" | 20 #include "third_party/skia/include/ports/SkFontMgr.h" |
22 | 21 |
23 namespace content { | 22 namespace content { |
24 | 23 |
25 namespace { | 24 namespace { |
26 | 25 |
27 class TestSkTypeface : public SkTypeface { | 26 class TestSkTypeface : public SkTypeface { |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); | 426 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); |
428 std::vector<char> data(data_size); | 427 std::vector<char> data(data_size); |
429 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); | 428 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); |
430 EXPECT_EQ(size, data_size); | 429 EXPECT_EQ(size, data_size); |
431 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); | 430 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); |
432 EXPECT_TRUE(DeleteObject(font)); | 431 EXPECT_TRUE(DeleteObject(font)); |
433 EXPECT_TRUE(DeleteDC(hdc)); | 432 EXPECT_TRUE(DeleteDC(hdc)); |
434 } | 433 } |
435 | 434 |
436 } // namespace content | 435 } // namespace content |
OLD | NEW |