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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(IsOS10_9()); | 149 EXPECT_TRUE(IsOS10_9()); |
150 EXPECT_TRUE(IsAtMostOS10_9()); | |
151 EXPECT_TRUE(IsAtLeastOS10_9()); | |
152 EXPECT_FALSE(IsOS10_10()); | 150 EXPECT_FALSE(IsOS10_10()); |
153 EXPECT_TRUE(IsAtMostOS10_10()); | 151 EXPECT_TRUE(IsAtMostOS10_10()); |
154 EXPECT_FALSE(IsAtLeastOS10_10()); | 152 EXPECT_FALSE(IsAtLeastOS10_10()); |
155 EXPECT_FALSE(IsOS10_11()); | 153 EXPECT_FALSE(IsOS10_11()); |
156 EXPECT_TRUE(IsAtMostOS10_11()); | 154 EXPECT_TRUE(IsAtMostOS10_11()); |
157 EXPECT_FALSE(IsAtLeastOS10_11()); | 155 EXPECT_FALSE(IsAtLeastOS10_11()); |
158 EXPECT_FALSE(IsOS10_12()); | 156 EXPECT_FALSE(IsOS10_12()); |
159 EXPECT_FALSE(IsAtLeastOS10_12()); | 157 EXPECT_FALSE(IsAtLeastOS10_12()); |
160 EXPECT_TRUE(IsAtMostOS10_12()); | 158 EXPECT_TRUE(IsAtMostOS10_12()); |
161 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); | 159 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); |
162 } else if (minor == 10) { | 160 } else if (minor == 10) { |
163 EXPECT_FALSE(IsOS10_9()); | 161 EXPECT_FALSE(IsOS10_9()); |
164 EXPECT_FALSE(IsAtMostOS10_9()); | |
165 EXPECT_TRUE(IsAtLeastOS10_9()); | |
166 EXPECT_TRUE(IsOS10_10()); | 162 EXPECT_TRUE(IsOS10_10()); |
167 EXPECT_TRUE(IsAtMostOS10_10()); | 163 EXPECT_TRUE(IsAtMostOS10_10()); |
168 EXPECT_TRUE(IsAtLeastOS10_10()); | 164 EXPECT_TRUE(IsAtLeastOS10_10()); |
169 EXPECT_FALSE(IsOS10_11()); | 165 EXPECT_FALSE(IsOS10_11()); |
170 EXPECT_TRUE(IsAtMostOS10_11()); | 166 EXPECT_TRUE(IsAtMostOS10_11()); |
171 EXPECT_FALSE(IsAtLeastOS10_11()); | 167 EXPECT_FALSE(IsAtLeastOS10_11()); |
172 EXPECT_FALSE(IsOS10_12()); | 168 EXPECT_FALSE(IsOS10_12()); |
173 EXPECT_FALSE(IsAtLeastOS10_12()); | 169 EXPECT_FALSE(IsAtLeastOS10_12()); |
174 EXPECT_TRUE(IsAtMostOS10_12()); | 170 EXPECT_TRUE(IsAtMostOS10_12()); |
175 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); | 171 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); |
176 } else if (minor == 11) { | 172 } else if (minor == 11) { |
177 EXPECT_FALSE(IsOS10_9()); | 173 EXPECT_FALSE(IsOS10_9()); |
178 EXPECT_FALSE(IsAtMostOS10_9()); | |
179 EXPECT_TRUE(IsAtLeastOS10_9()); | |
180 EXPECT_FALSE(IsOS10_10()); | 174 EXPECT_FALSE(IsOS10_10()); |
181 EXPECT_FALSE(IsAtMostOS10_10()); | 175 EXPECT_FALSE(IsAtMostOS10_10()); |
182 EXPECT_TRUE(IsAtLeastOS10_10()); | 176 EXPECT_TRUE(IsAtLeastOS10_10()); |
183 EXPECT_TRUE(IsOS10_11()); | 177 EXPECT_TRUE(IsOS10_11()); |
184 EXPECT_TRUE(IsAtMostOS10_11()); | 178 EXPECT_TRUE(IsAtMostOS10_11()); |
185 EXPECT_TRUE(IsAtLeastOS10_11()); | 179 EXPECT_TRUE(IsAtLeastOS10_11()); |
186 EXPECT_FALSE(IsOS10_12()); | 180 EXPECT_FALSE(IsOS10_12()); |
187 EXPECT_FALSE(IsAtLeastOS10_12()); | 181 EXPECT_FALSE(IsAtLeastOS10_12()); |
188 EXPECT_TRUE(IsAtMostOS10_12()); | 182 EXPECT_TRUE(IsAtMostOS10_12()); |
189 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); | 183 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); |
190 } else if (minor == 12) { | 184 } else if (minor == 12) { |
191 EXPECT_FALSE(IsOS10_9()); | 185 EXPECT_FALSE(IsOS10_9()); |
192 EXPECT_FALSE(IsAtMostOS10_9()); | |
193 EXPECT_TRUE(IsAtLeastOS10_9()); | |
194 EXPECT_FALSE(IsOS10_10()); | 186 EXPECT_FALSE(IsOS10_10()); |
195 EXPECT_FALSE(IsAtMostOS10_10()); | 187 EXPECT_FALSE(IsAtMostOS10_10()); |
196 EXPECT_TRUE(IsAtLeastOS10_10()); | 188 EXPECT_TRUE(IsAtLeastOS10_10()); |
197 EXPECT_FALSE(IsOS10_11()); | 189 EXPECT_FALSE(IsOS10_11()); |
198 EXPECT_FALSE(IsAtMostOS10_11()); | 190 EXPECT_FALSE(IsAtMostOS10_11()); |
199 EXPECT_TRUE(IsAtLeastOS10_11()); | 191 EXPECT_TRUE(IsAtLeastOS10_11()); |
200 EXPECT_TRUE(IsOS10_12()); | 192 EXPECT_TRUE(IsOS10_12()); |
201 EXPECT_TRUE(IsAtMostOS10_12()); | 193 EXPECT_TRUE(IsAtMostOS10_12()); |
202 EXPECT_TRUE(IsAtLeastOS10_12()); | 194 EXPECT_TRUE(IsAtLeastOS10_12()); |
203 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); | 195 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 261 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
270 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); | 262 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); |
271 ASSERT_FALSE(PathExists(non_existent_path)); | 263 ASSERT_FALSE(PathExists(non_existent_path)); |
272 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); | 264 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); |
273 } | 265 } |
274 | 266 |
275 } // namespace | 267 } // namespace |
276 | 268 |
277 } // namespace mac | 269 } // namespace mac |
278 } // namespace base | 270 } // namespace base |
OLD | NEW |