OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 int32 major, minor, bugfix; | 154 int32 major, minor, bugfix; |
155 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | 155 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
156 | 156 |
157 if (major == 10) { | 157 if (major == 10) { |
158 if (minor == 6) { | 158 if (minor == 6) { |
159 EXPECT_TRUE(IsOSSnowLeopard()); | 159 EXPECT_TRUE(IsOSSnowLeopard()); |
160 EXPECT_FALSE(IsOSLion()); | 160 EXPECT_FALSE(IsOSLion()); |
161 EXPECT_TRUE(IsOSLionOrEarlier()); | 161 EXPECT_TRUE(IsOSLionOrEarlier()); |
162 EXPECT_FALSE(IsOSLionOrLater()); | 162 EXPECT_FALSE(IsOSLionOrLater()); |
163 EXPECT_FALSE(IsOSMountainLion()); | 163 EXPECT_FALSE(IsOSMountainLion()); |
| 164 EXPECT_TRUE(IsOSMountainLionOrEarlier()); |
164 EXPECT_FALSE(IsOSMountainLionOrLater()); | 165 EXPECT_FALSE(IsOSMountainLionOrLater()); |
165 EXPECT_FALSE(IsOSLaterThanMountainLion_DontCallThis()); | 166 EXPECT_FALSE(IsOSMavericks()); |
| 167 EXPECT_FALSE(IsOSMavericksOrLater()); |
| 168 EXPECT_FALSE(IsOSLaterThanMavericks_DontCallThis()); |
166 } else if (minor == 7) { | 169 } else if (minor == 7) { |
167 EXPECT_FALSE(IsOSSnowLeopard()); | 170 EXPECT_FALSE(IsOSSnowLeopard()); |
168 EXPECT_TRUE(IsOSLion()); | 171 EXPECT_TRUE(IsOSLion()); |
169 EXPECT_TRUE(IsOSLionOrEarlier()); | 172 EXPECT_TRUE(IsOSLionOrEarlier()); |
170 EXPECT_TRUE(IsOSLionOrLater()); | 173 EXPECT_TRUE(IsOSLionOrLater()); |
171 EXPECT_FALSE(IsOSMountainLion()); | 174 EXPECT_FALSE(IsOSMountainLion()); |
| 175 EXPECT_TRUE(IsOSMountainLionOrEarlier()); |
172 EXPECT_FALSE(IsOSMountainLionOrLater()); | 176 EXPECT_FALSE(IsOSMountainLionOrLater()); |
173 EXPECT_FALSE(IsOSLaterThanMountainLion_DontCallThis()); | 177 EXPECT_FALSE(IsOSMavericks()); |
| 178 EXPECT_FALSE(IsOSMavericksOrLater()); |
| 179 EXPECT_FALSE(IsOSLaterThanMavericks_DontCallThis()); |
174 } else if (minor == 8) { | 180 } else if (minor == 8) { |
175 EXPECT_FALSE(IsOSSnowLeopard()); | 181 EXPECT_FALSE(IsOSSnowLeopard()); |
176 EXPECT_FALSE(IsOSLion()); | 182 EXPECT_FALSE(IsOSLion()); |
177 EXPECT_FALSE(IsOSLionOrEarlier()); | 183 EXPECT_FALSE(IsOSLionOrEarlier()); |
178 EXPECT_TRUE(IsOSLionOrLater()); | 184 EXPECT_TRUE(IsOSLionOrLater()); |
179 EXPECT_TRUE(IsOSMountainLion()); | 185 EXPECT_TRUE(IsOSMountainLion()); |
| 186 EXPECT_TRUE(IsOSMountainLionOrEarlier()); |
180 EXPECT_TRUE(IsOSMountainLionOrLater()); | 187 EXPECT_TRUE(IsOSMountainLionOrLater()); |
181 EXPECT_FALSE(IsOSLaterThanMountainLion_DontCallThis()); | 188 EXPECT_FALSE(IsOSMavericks()); |
| 189 EXPECT_FALSE(IsOSMavericksOrLater()); |
| 190 EXPECT_FALSE(IsOSLaterThanMavericks_DontCallThis()); |
| 191 } else if (minor == 9) { |
| 192 EXPECT_FALSE(IsOSSnowLeopard()); |
| 193 EXPECT_FALSE(IsOSLion()); |
| 194 EXPECT_FALSE(IsOSLionOrEarlier()); |
| 195 EXPECT_TRUE(IsOSLionOrLater()); |
| 196 EXPECT_FALSE(IsOSMountainLion()); |
| 197 EXPECT_FALSE(IsOSMountainLionOrEarlier()); |
| 198 EXPECT_TRUE(IsOSMountainLionOrLater()); |
| 199 EXPECT_TRUE(IsOSMavericks()); |
| 200 EXPECT_TRUE(IsOSMavericksOrLater()); |
| 201 EXPECT_FALSE(IsOSLaterThanMavericks_DontCallThis()); |
182 } else { | 202 } else { |
183 // Not five, six, seven, or eight. Ah, ah, ah. | 203 // Not five, six, seven, eight, or nine. Ah, ah, ah. |
184 EXPECT_TRUE(false); | 204 EXPECT_TRUE(false); |
185 } | 205 } |
186 } else { | 206 } else { |
187 // Not ten. What you gonna do? | 207 // Not ten. What you gonna do? |
188 EXPECT_FALSE(true); | 208 EXPECT_FALSE(true); |
189 } | 209 } |
190 } | 210 } |
191 | 211 |
192 TEST_F(MacUtilTest, ParseModelIdentifier) { | 212 TEST_F(MacUtilTest, ParseModelIdentifier) { |
193 std::string model; | 213 std::string model; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 267 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
248 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); | 268 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); |
249 ASSERT_FALSE(PathExists(non_existent_path)); | 269 ASSERT_FALSE(PathExists(non_existent_path)); |
250 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); | 270 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); |
251 } | 271 } |
252 | 272 |
253 } // namespace | 273 } // namespace |
254 | 274 |
255 } // namespace mac | 275 } // namespace mac |
256 } // namespace base | 276 } // namespace base |
OLD | NEW |