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

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

Issue 2581083003: Initial OpenType Font Variations Support (Closed)
Patch Set: Fix hash collision tests, adjust test expectations Created 4 years 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 26 matching lines...) Expand all
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 45 // Even if the hash value collide, fontface cache should return different
46 // value for different fonts. 46 // value for different fonts.
47 EXPECT_EQ(simulateHashCalculation(2821), simulateHashCalculation(3346)); 47 EXPECT_EQ(simulateHashCalculation(8775), simulateHashCalculation(418));
48 EXPECT_NE(fontFaceSource.getFontDataForSize(2821), 48 EXPECT_NE(fontFaceSource.getFontDataForSize(8775),
49 fontFaceSource.getFontDataForSize(3346)); 49 fontFaceSource.getFontDataForSize(418));
50 } 50 }
51 51
52 } // namespace blink 52 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698