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

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

Issue 2392343005: Reflow comments in core/css (Closed)
Patch Set: Revert clang-format Created 4 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
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"
(...skipping 24 matching lines...) Expand all
35 unsigned simulateHashCalculation(float size) { 35 unsigned simulateHashCalculation(float size) {
36 FontDescription fontDescription; 36 FontDescription fontDescription;
37 fontDescription.setSizeAdjust(size); 37 fontDescription.setSizeAdjust(size);
38 fontDescription.setAdjustedSize(size); 38 fontDescription.setAdjustedSize(size);
39 return fontDescription.cacheKey(FontFaceCreationParams()).hash(); 39 return fontDescription.cacheKey(FontFaceCreationParams()).hash();
40 } 40 }
41 } 41 }
42 42
43 TEST(CSSFontFaceSourceTest, HashCollision) { 43 TEST(CSSFontFaceSourceTest, HashCollision) {
44 DummyFontFaceSource fontFaceSource; 44 DummyFontFaceSource fontFaceSource;
45 // Even if the hash value collide, fontface cache should return different valu e for different fonts. 45 // Even if the hash value collide, fontface cache should return different
46 // value for different fonts.
46 EXPECT_EQ(simulateHashCalculation(2821), simulateHashCalculation(3346)); 47 EXPECT_EQ(simulateHashCalculation(2821), simulateHashCalculation(3346));
47 EXPECT_NE(fontFaceSource.getFontDataForSize(2821), 48 EXPECT_NE(fontFaceSource.getFontDataForSize(2821),
48 fontFaceSource.getFontDataForSize(3346)); 49 fontFaceSource.getFontDataForSize(3346));
49 } 50 }
50 51
51 } // namespace blink 52 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontFaceSource.cpp ('k') | third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698