| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |