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

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

Issue 2288003002: Delete IsAtLeastOS10_9() and IsAtMostOS10_9() (Closed)
Patch Set: Clean up a duplicate check, delete a stray ! Created 4 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
« no previous file with comments | « no previous file | base/sys_info_mac.mm » ('j') | base/sys_info_mac.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(IsOS10_9());
150 EXPECT_TRUE(IsAtMostOS10_9());
151 EXPECT_TRUE(IsAtLeastOS10_9());
152 EXPECT_FALSE(IsOS10_10()); 149 EXPECT_FALSE(IsOS10_10());
153 EXPECT_TRUE(IsAtMostOS10_10()); 150 EXPECT_TRUE(IsAtMostOS10_10());
154 EXPECT_FALSE(IsAtLeastOS10_10()); 151 EXPECT_FALSE(IsAtLeastOS10_10());
155 EXPECT_FALSE(IsOS10_11()); 152 EXPECT_FALSE(IsOS10_11());
156 EXPECT_TRUE(IsAtMostOS10_11()); 153 EXPECT_TRUE(IsAtMostOS10_11());
157 EXPECT_FALSE(IsAtLeastOS10_11()); 154 EXPECT_FALSE(IsAtLeastOS10_11());
158 EXPECT_FALSE(IsOS10_12()); 155 EXPECT_FALSE(IsOS10_12());
159 EXPECT_FALSE(IsAtLeastOS10_12()); 156 EXPECT_FALSE(IsAtLeastOS10_12());
160 EXPECT_TRUE(IsAtMostOS10_12()); 157 EXPECT_TRUE(IsAtMostOS10_12());
161 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); 158 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
162 } else if (minor == 10) { 159 } else if (minor == 10) {
163 EXPECT_FALSE(IsOS10_9());
164 EXPECT_FALSE(IsAtMostOS10_9());
165 EXPECT_TRUE(IsAtLeastOS10_9());
166 EXPECT_TRUE(IsOS10_10()); 160 EXPECT_TRUE(IsOS10_10());
167 EXPECT_TRUE(IsAtMostOS10_10()); 161 EXPECT_TRUE(IsAtMostOS10_10());
168 EXPECT_TRUE(IsAtLeastOS10_10()); 162 EXPECT_TRUE(IsAtLeastOS10_10());
169 EXPECT_FALSE(IsOS10_11()); 163 EXPECT_FALSE(IsOS10_11());
170 EXPECT_TRUE(IsAtMostOS10_11()); 164 EXPECT_TRUE(IsAtMostOS10_11());
171 EXPECT_FALSE(IsAtLeastOS10_11()); 165 EXPECT_FALSE(IsAtLeastOS10_11());
172 EXPECT_FALSE(IsOS10_12()); 166 EXPECT_FALSE(IsOS10_12());
173 EXPECT_FALSE(IsAtLeastOS10_12()); 167 EXPECT_FALSE(IsAtLeastOS10_12());
174 EXPECT_TRUE(IsAtMostOS10_12()); 168 EXPECT_TRUE(IsAtMostOS10_12());
175 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); 169 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
176 } else if (minor == 11) { 170 } else if (minor == 11) {
177 EXPECT_FALSE(IsOS10_9());
178 EXPECT_FALSE(IsAtMostOS10_9());
179 EXPECT_TRUE(IsAtLeastOS10_9());
180 EXPECT_FALSE(IsOS10_10()); 171 EXPECT_FALSE(IsOS10_10());
181 EXPECT_FALSE(IsAtMostOS10_10()); 172 EXPECT_FALSE(IsAtMostOS10_10());
182 EXPECT_TRUE(IsAtLeastOS10_10()); 173 EXPECT_TRUE(IsAtLeastOS10_10());
183 EXPECT_TRUE(IsOS10_11()); 174 EXPECT_TRUE(IsOS10_11());
184 EXPECT_TRUE(IsAtMostOS10_11()); 175 EXPECT_TRUE(IsAtMostOS10_11());
185 EXPECT_TRUE(IsAtLeastOS10_11()); 176 EXPECT_TRUE(IsAtLeastOS10_11());
186 EXPECT_FALSE(IsOS10_12()); 177 EXPECT_FALSE(IsOS10_12());
187 EXPECT_FALSE(IsAtLeastOS10_12()); 178 EXPECT_FALSE(IsAtLeastOS10_12());
188 EXPECT_TRUE(IsAtMostOS10_12()); 179 EXPECT_TRUE(IsAtMostOS10_12());
189 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); 180 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
190 } else if (minor == 12) { 181 } else if (minor == 12) {
191 EXPECT_FALSE(IsOS10_9());
192 EXPECT_FALSE(IsAtMostOS10_9());
193 EXPECT_TRUE(IsAtLeastOS10_9());
194 EXPECT_FALSE(IsOS10_10()); 182 EXPECT_FALSE(IsOS10_10());
195 EXPECT_FALSE(IsAtMostOS10_10()); 183 EXPECT_FALSE(IsAtMostOS10_10());
196 EXPECT_TRUE(IsAtLeastOS10_10()); 184 EXPECT_TRUE(IsAtLeastOS10_10());
197 EXPECT_FALSE(IsOS10_11()); 185 EXPECT_FALSE(IsOS10_11());
198 EXPECT_FALSE(IsAtMostOS10_11()); 186 EXPECT_FALSE(IsAtMostOS10_11());
199 EXPECT_TRUE(IsAtLeastOS10_11()); 187 EXPECT_TRUE(IsAtLeastOS10_11());
200 EXPECT_TRUE(IsOS10_12()); 188 EXPECT_TRUE(IsOS10_12());
201 EXPECT_TRUE(IsAtMostOS10_12()); 189 EXPECT_TRUE(IsAtMostOS10_12());
202 EXPECT_TRUE(IsAtLeastOS10_12()); 190 EXPECT_TRUE(IsAtLeastOS10_12());
203 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis()); 191 EXPECT_FALSE(IsOSLaterThan10_12_DontCallThis());
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 257 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
270 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); 258 FilePath non_existent_path = temp_dir_.path().Append("DummyPath");
271 ASSERT_FALSE(PathExists(non_existent_path)); 259 ASSERT_FALSE(PathExists(non_existent_path));
272 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); 260 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path));
273 } 261 }
274 262
275 } // namespace 263 } // namespace
276 264
277 } // namespace mac 265 } // namespace mac
278 } // namespace base 266 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/sys_info_mac.mm » ('j') | base/sys_info_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698