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

Side by Side Diff: base/mac/mac_util_unittest.mm

Issue 7740055: Set user-visible machine names and devices types for synced sessions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Split off platform-specific code to various util files, addressed comments Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/mac/mac_util.h" 7 #include "base/mac/mac_util.h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 scoped_nsobject<NSArray> array([[NSArray alloc] initWithObjects:@"foo", nil]); 154 scoped_nsobject<NSArray> array([[NSArray alloc] initWithObjects:@"foo", nil]);
155 EXPECT_EQ(1U, [array retainCount]); 155 EXPECT_EQ(1U, [array retainCount]);
156 156
157 NSObjectRetain(array); 157 NSObjectRetain(array);
158 EXPECT_EQ(2U, [array retainCount]); 158 EXPECT_EQ(2U, [array retainCount]);
159 159
160 NSObjectRelease(array); 160 NSObjectRelease(array);
161 EXPECT_EQ(1U, [array retainCount]); 161 EXPECT_EQ(1U, [array retainCount]);
162 } 162 }
163 163
164 // The test is somewhat silly, and just verifies that we return a hardware
165 // model name.
166 TEST_F(MacUtilTest, GetHardwareModelName) {
167 std::string hardware_model = GetHardwareModelName();
168 EXPECT_TRUE(!hardware_model.empty());
169 }
170
164 TEST_F(MacUtilTest, IsOSEllipsis) { 171 TEST_F(MacUtilTest, IsOSEllipsis) {
165 int32 major, minor, bugfix; 172 int32 major, minor, bugfix;
166 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); 173 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
167 174
168 if (major == 10) { 175 if (major == 10) {
169 if (minor == 5) { 176 if (minor == 5) {
170 EXPECT_TRUE(IsOSLeopard()); 177 EXPECT_TRUE(IsOSLeopard());
171 EXPECT_TRUE(IsOSLeopardOrEarlier()); 178 EXPECT_TRUE(IsOSLeopardOrEarlier());
172 EXPECT_FALSE(IsOSSnowLeopard()); 179 EXPECT_FALSE(IsOSSnowLeopard());
173 EXPECT_TRUE(IsOSSnowLeopardOrEarlier()); 180 EXPECT_TRUE(IsOSSnowLeopardOrEarlier());
(...skipping 26 matching lines...) Expand all
200 } else { 207 } else {
201 // Not ten. What you gonna do? 208 // Not ten. What you gonna do?
202 EXPECT_FALSE(true); 209 EXPECT_FALSE(true);
203 } 210 }
204 } 211 }
205 212
206 } // namespace 213 } // namespace
207 214
208 } // namespace mac 215 } // namespace mac
209 } // namespace base 216 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698