OLD | NEW |
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 #import "ui/gfx/ios/NSString+CrStringDrawing.h" | 4 #import "ui/gfx/ios/NSString+CrStringDrawing.h" |
5 | 5 |
6 #include "base/mac/scoped_nsobject.h" | 6 #include "base/mac/scoped_nsobject.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "testing/gtest_mac.h" | 10 #include "testing/gtest_mac.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | |
11 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 typedef PlatformTest NSStringCrStringDrawing; | 15 typedef PlatformTest NSStringCrStringDrawing; |
16 | 16 |
17 // These tests verify that the category methods return the same values as the | 17 // These tests verify that the category methods return the same values as the |
18 // deprecated methods, so ignore warnings about using deprecated methods. | 18 // deprecated methods, so ignore warnings about using deprecated methods. |
19 #pragma clang diagnostic push | 19 #pragma clang diagnostic push |
20 #pragma clang diagnostic ignored "-Wdeprecated-declarations" | 20 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 EXPECT_NSEQ(@"", result); | 163 EXPECT_NSEQ(@"", result); |
164 result = [@"lorem ipsum dolores" | 164 result = [@"lorem ipsum dolores" |
165 cr_stringByElidingToFitSize:CGSizeMake(1000, 1000)]; | 165 cr_stringByElidingToFitSize:CGSizeMake(1000, 1000)]; |
166 EXPECT_NSEQ(@"lorem ipsum dolores", result); | 166 EXPECT_NSEQ(@"lorem ipsum dolores", result); |
167 result = | 167 result = |
168 [@"lorem ipsum dolores" cr_stringByElidingToFitSize:CGSizeMake(30, 50)]; | 168 [@"lorem ipsum dolores" cr_stringByElidingToFitSize:CGSizeMake(30, 50)]; |
169 EXPECT_TRUE([@"lorem ipsum dolores" length] > [result length]); | 169 EXPECT_TRUE([@"lorem ipsum dolores" length] > [result length]); |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
OLD | NEW |