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

Side by Side Diff: ui/gfx/ios/uikit_util_unittest.mm

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/gfx/ios/NSString+CrStringDrawing.mm ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 #include <stddef.h>
6 7
7 #include "base/basictypes.h" 8 #include "base/macros.h"
8 #include "testing/platform_test.h" 9 #include "testing/platform_test.h"
9 #import "ui/gfx/ios/uikit_util.h" 10 #import "ui/gfx/ios/uikit_util.h"
10 11
11 namespace { 12 namespace {
12 13
13 typedef PlatformTest UIKitUtilTest; 14 typedef PlatformTest UIKitUtilTest;
14 15
15 TEST_F(UIKitUtilTest, AlignValueToUpperPixel) { 16 TEST_F(UIKitUtilTest, AlignValueToUpperPixel) {
16 CGFloat scale = [[UIScreen mainScreen] scale]; 17 CGFloat scale = [[UIScreen mainScreen] scale];
17 // Pick a few interesting values: already aligned, aligned on retina, and 18 // Pick a few interesting values: already aligned, aligned on retina, and
(...skipping 24 matching lines...) Expand all
42 EXPECT_FLOAT_EQ(floor(alignedSize.width * scale), 43 EXPECT_FLOAT_EQ(floor(alignedSize.width * scale),
43 alignedSize.width * scale); 44 alignedSize.width * scale);
44 EXPECT_FLOAT_EQ(floor(alignedSize.height * scale), 45 EXPECT_FLOAT_EQ(floor(alignedSize.height * scale),
45 alignedSize.height * scale); 46 alignedSize.height * scale);
46 EXPECT_NEAR(width * scale, alignedSize.width * scale, kMaxAlignDelta); 47 EXPECT_NEAR(width * scale, alignedSize.width * scale, kMaxAlignDelta);
47 EXPECT_NEAR(height * scale, alignedSize.height * scale, kMaxAlignDelta); 48 EXPECT_NEAR(height * scale, alignedSize.height * scale, kMaxAlignDelta);
48 } 49 }
49 } 50 }
50 51
51 } // namespace 52 } // namespace
OLDNEW
« no previous file with comments | « ui/gfx/ios/NSString+CrStringDrawing.mm ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698