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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFontFaceSourceTest.cpp

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... Created 4 years, 3 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 | third_party/WebKit/Source/core/frame/ImageBitmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/css/CSSFontFaceSource.h" 5 #include "core/css/CSSFontFaceSource.h"
6 6
7 #include "platform/fonts/FontCacheKey.h" 7 #include "platform/fonts/FontCacheKey.h"
8 #include "platform/fonts/FontDescription.h" 8 #include "platform/fonts/FontDescription.h"
9 #include "platform/fonts/FontPlatformData.h" 9 #include "platform/fonts/FontPlatformData.h"
10 #include "platform/fonts/SimpleFontData.h" 10 #include "platform/fonts/SimpleFontData.h"
11 #include "platform/graphics/skia/SkiaUtils.h" 11 #include "platform/graphics/skia/SkiaUtils.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class DummyFontFaceSource : public CSSFontFaceSource { 16 class DummyFontFaceSource : public CSSFontFaceSource {
17 public: 17 public:
18 PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override 18 PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override
19 { 19 {
20 return SimpleFontData::create(FontPlatformData(fromSkSp(SkTypeface::Make Default()), "", 0, false, false)); 20 return SimpleFontData::create(FontPlatformData(SkTypeface::MakeDefault() , "", 0, false, false));
21 } 21 }
22 22
23 DummyFontFaceSource() { } 23 DummyFontFaceSource() { }
24 24
25 PassRefPtr<SimpleFontData> getFontDataForSize(float size) 25 PassRefPtr<SimpleFontData> getFontDataForSize(float size)
26 { 26 {
27 FontDescription fontDescription; 27 FontDescription fontDescription;
28 fontDescription.setSizeAdjust(size); 28 fontDescription.setSizeAdjust(size);
29 fontDescription.setAdjustedSize(size); 29 fontDescription.setAdjustedSize(size);
30 return getFontData(fontDescription); 30 return getFontData(fontDescription);
(...skipping 14 matching lines...) Expand all
45 45
46 TEST(CSSFontFaceSourceTest, HashCollision) 46 TEST(CSSFontFaceSourceTest, HashCollision)
47 { 47 {
48 DummyFontFaceSource fontFaceSource; 48 DummyFontFaceSource fontFaceSource;
49 // Even if the hash value collide, fontface cache should return different va lue for different fonts. 49 // Even if the hash value collide, fontface cache should return different va lue for different fonts.
50 EXPECT_EQ(simulateHashCalculation(2821), simulateHashCalculation(3346)); 50 EXPECT_EQ(simulateHashCalculation(2821), simulateHashCalculation(3346));
51 EXPECT_NE(fontFaceSource.getFontDataForSize(2821), fontFaceSource.getFontDat aForSize(3346)); 51 EXPECT_NE(fontFaceSource.getFontDataForSize(2821), fontFaceSource.getFontDat aForSize(3346));
52 } 52 }
53 53
54 } // namespace blink 54 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698