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 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 NSObjectRelease(array); | 139 NSObjectRelease(array); |
140 EXPECT_EQ(1U, [array retainCount]); | 140 EXPECT_EQ(1U, [array retainCount]); |
141 } | 141 } |
142 | 142 |
143 TEST_F(MacUtilTest, IsOSEllipsis) { | 143 TEST_F(MacUtilTest, IsOSEllipsis) { |
144 int32_t major, minor, bugfix; | 144 int32_t major, minor, bugfix; |
145 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | 145 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
146 | 146 |
147 if (major == 10) { | 147 if (major == 10) { |
148 if (minor == 9) { | 148 if (minor == 9) { |
149 EXPECT_TRUE(IsOSMavericks()); | 149 EXPECT_TRUE(IsOS10_9()); |
150 EXPECT_FALSE(IsOSYosemite()); | 150 EXPECT_FALSE(IsOS10_10()); |
151 EXPECT_TRUE(IsOSYosemiteOrEarlier()); | 151 EXPECT_TRUE(IsAtMostOS10_10()); |
152 EXPECT_FALSE(IsOSYosemiteOrLater()); | 152 EXPECT_FALSE(IsAtLeastOS10_10()); |
153 EXPECT_FALSE(IsOSElCapitan()); | 153 EXPECT_FALSE(IsOS10_11()); |
154 EXPECT_TRUE(IsOSElCapitanOrEarlier()); | 154 EXPECT_TRUE(IsAtMostOS10_11()); |
155 EXPECT_FALSE(IsOSElCapitanOrLater()); | 155 EXPECT_FALSE(IsAtLeastOS10_11()); |
156 EXPECT_FALSE(IsOSSierra()); | 156 EXPECT_FALSE(IsOS10_12()); |
157 EXPECT_FALSE(IsOSSierraOrLater()); | 157 EXPECT_FALSE(IsAtLeastOS10_12()); |
158 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); | 158 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); |
159 } else if (minor == 10) { | 159 } else if (minor == 10) { |
160 EXPECT_FALSE(IsOSMavericks()); | 160 EXPECT_FALSE(IsOS10_9()); |
161 EXPECT_TRUE(IsOSYosemite()); | 161 EXPECT_TRUE(IsOS10_10()); |
162 EXPECT_TRUE(IsOSYosemiteOrEarlier()); | 162 EXPECT_TRUE(IsAtMostOS10_10()); |
163 EXPECT_TRUE(IsOSYosemiteOrLater()); | 163 EXPECT_TRUE(IsAtLeastOS10_10()); |
164 EXPECT_FALSE(IsOSElCapitan()); | 164 EXPECT_FALSE(IsOS10_11()); |
165 EXPECT_TRUE(IsOSElCapitanOrEarlier()); | 165 EXPECT_TRUE(IsAtMostOS10_11()); |
166 EXPECT_FALSE(IsOSElCapitanOrLater()); | 166 EXPECT_FALSE(IsAtLeastOS10_11()); |
167 EXPECT_FALSE(IsOSSierra()); | 167 EXPECT_FALSE(IsOS10_12()); |
168 EXPECT_FALSE(IsOSSierraOrLater()); | 168 EXPECT_FALSE(IsAtLeastOS10_12()); |
169 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); | 169 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); |
170 } else if (minor == 11) { | 170 } else if (minor == 11) { |
171 EXPECT_FALSE(IsOSMavericks()); | 171 EXPECT_FALSE(IsOS10_9()); |
172 EXPECT_FALSE(IsOSYosemite()); | 172 EXPECT_FALSE(IsOS10_10()); |
173 EXPECT_FALSE(IsOSYosemiteOrEarlier()); | 173 EXPECT_FALSE(IsAtMostOS10_10()); |
174 EXPECT_TRUE(IsOSYosemiteOrLater()); | 174 EXPECT_TRUE(IsAtLeastOS10_10()); |
175 EXPECT_TRUE(IsOSElCapitan()); | 175 EXPECT_TRUE(IsOS10_11()); |
176 EXPECT_TRUE(IsOSElCapitanOrEarlier()); | 176 EXPECT_TRUE(IsAtMostOS10_11()); |
177 EXPECT_TRUE(IsOSElCapitanOrLater()); | 177 EXPECT_TRUE(IsAtLeastOS10_11()); |
178 EXPECT_FALSE(IsOSSierra()); | 178 EXPECT_FALSE(IsOS10_12()); |
179 EXPECT_FALSE(IsOSSierraOrLater()); | 179 EXPECT_FALSE(IsAtLeastOS10_12()); |
180 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); | 180 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); |
181 } else if (minor == 12) { | 181 } else if (minor == 12) { |
182 EXPECT_FALSE(IsOSMavericks()); | 182 EXPECT_FALSE(IsOS10_9()); |
183 EXPECT_FALSE(IsOSYosemite()); | 183 EXPECT_FALSE(IsOS10_10()); |
184 EXPECT_FALSE(IsOSYosemiteOrEarlier()); | 184 EXPECT_FALSE(IsAtMostOS10_10()); |
185 EXPECT_TRUE(IsOSYosemiteOrLater()); | 185 EXPECT_TRUE(IsAtLeastOS10_10()); |
186 EXPECT_FALSE(IsOSElCapitan()); | 186 EXPECT_FALSE(IsOS10_11()); |
187 EXPECT_FALSE(IsOSElCapitanOrEarlier()); | 187 EXPECT_FALSE(IsAtMostOS10_11()); |
188 EXPECT_TRUE(IsOSElCapitanOrLater()); | 188 EXPECT_TRUE(IsAtLeastOS10_11()); |
189 EXPECT_TRUE(IsOSSierra()); | 189 EXPECT_TRUE(IsOS10_12()); |
190 EXPECT_TRUE(IsOSSierraOrLater()); | 190 EXPECT_TRUE(IsAtLeastOS10_12()); |
191 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); | 191 EXPECT_FALSE(IsOSLaterThanSierra_DontCallThis()); |
192 } else { | 192 } else { |
193 // Not nine, ten, eleven, or twelve. Ah, ah, ah. | 193 // Not nine, ten, eleven, or twelve. Ah, ah, ah. |
194 EXPECT_TRUE(false); | 194 EXPECT_TRUE(false); |
195 } | 195 } |
196 } else { | 196 } else { |
197 // Not ten. What you gonna do? | 197 // Not ten. What you gonna do? |
198 EXPECT_FALSE(true); | 198 EXPECT_FALSE(true); |
199 } | 199 } |
200 } | 200 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 257 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
258 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); | 258 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); |
259 ASSERT_FALSE(PathExists(non_existent_path)); | 259 ASSERT_FALSE(PathExists(non_existent_path)); |
260 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); | 260 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); |
261 } | 261 } |
262 | 262 |
263 } // namespace | 263 } // namespace |
264 | 264 |
265 } // namespace mac | 265 } // namespace mac |
266 } // namespace base | 266 } // namespace base |
OLD | NEW |