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

Side by Side Diff: third_party/WebKit/Source/platform/mac/VersionUtilMacTest.mm

Issue 2271653006: base::mac::IsOSSierra() -> base::mac::IsOS10_12(), etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Nits 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 | « third_party/WebKit/Source/platform/mac/VersionUtilMac.mm ('k') | ui/base/cocoa/appkit_utils.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/mac/VersionUtilMac.h" 5 #import "platform/mac/VersionUtilMac.h"
6 6
7 #include <AppKit/AppKit.h> 7 #include <AppKit/AppKit.h>
8 #include <gtest/gtest.h> 8 #include <gtest/gtest.h>
9 9
10 #ifndef NSAppKitVersionNumber10_9 10 #ifndef NSAppKitVersionNumber10_9
(...skipping 11 matching lines...) Expand all
22 // AppKit.framework does not provide an NSAppKitVersionNumber preprocessor 22 // AppKit.framework does not provide an NSAppKitVersionNumber preprocessor
23 // definition for OSX 10.11. 23 // definition for OSX 10.11.
24 #define NSAppKitVersionNumber10_11Max 1389 24 #define NSAppKitVersionNumber10_11Max 1389
25 25
26 // AppKit version is loosely correlated to OSX version. It's still useful as a 26 // AppKit version is loosely correlated to OSX version. It's still useful as a
27 // sanity check in unit tests, though we don't want to rely on it in production 27 // sanity check in unit tests, though we don't want to rely on it in production
28 // code. 28 // code.
29 TEST(VersionUtilMac, AppKitVersions) 29 TEST(VersionUtilMac, AppKitVersions)
30 { 30 {
31 if (floor(NSAppKitVersionNumber) == NSAppKitVersionNumber10_9) { 31 if (floor(NSAppKitVersionNumber) == NSAppKitVersionNumber10_9) {
32 EXPECT_TRUE(blink::IsOSMavericks()); 32 EXPECT_TRUE(blink::IsOS10_9());
33 EXPECT_FALSE(blink::IsOSYosemite()); 33 EXPECT_FALSE(blink::IsOS10_10());
34 EXPECT_FALSE(blink::IsOSElCapitan()); 34 EXPECT_FALSE(blink::IsOS10_11());
35 return; 35 return;
36 } 36 }
37 37
38 if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10Max && 38 if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10Max &&
39 floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_10) { 39 floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_10) {
40 EXPECT_FALSE(blink::IsOSMavericks()); 40 EXPECT_FALSE(blink::IsOS10_9());
41 EXPECT_TRUE(blink::IsOSYosemite()); 41 EXPECT_TRUE(blink::IsOS10_10());
42 EXPECT_FALSE(blink::IsOSElCapitan()); 42 EXPECT_FALSE(blink::IsOS10_11());
43 return; 43 return;
44 } 44 }
45 45
46 if (floor(NSAppKitVersionNumber) == NSAppKitVersionNumber10_11Max) { 46 if (floor(NSAppKitVersionNumber) == NSAppKitVersionNumber10_11Max) {
47 EXPECT_FALSE(blink::IsOSMavericks()); 47 EXPECT_FALSE(blink::IsOS10_9());
48 EXPECT_FALSE(blink::IsOSYosemite()); 48 EXPECT_FALSE(blink::IsOS10_10());
49 EXPECT_TRUE(blink::IsOSElCapitan()); 49 EXPECT_TRUE(blink::IsOS10_11());
50 return; 50 return;
51 } 51 }
52 } 52 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/mac/VersionUtilMac.mm ('k') | ui/base/cocoa/appkit_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698