| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "base/test/expectations/expectation.h" | 5 #include "base/test/expectations/expectation.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 10 #include "base/win/windows_version.h" | |
| 11 #elif defined(OS_MACOSX) && !defined(OS_IOS) | |
| 12 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| 13 #elif defined(OS_LINUX) | 11 #elif defined(OS_LINUX) |
| 14 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 15 #endif | 13 #endif |
| 16 | 14 |
| 17 namespace test_expectations { | 15 namespace test_expectations { |
| 18 | 16 |
| 19 bool ResultFromString(const base::StringPiece& result, Result* out_result) { | 17 bool ResultFromString(const base::StringPiece& result, Result* out_result) { |
| 20 if (result == "Failure") | 18 if (result == "Failure") |
| 21 *out_result = RESULT_FAILURE; | 19 *out_result = RESULT_FAILURE; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } else { | 80 } else { |
| 83 out_platform->name = modifier.substr(0, sep).as_string(); | 81 out_platform->name = modifier.substr(0, sep).as_string(); |
| 84 out_platform->variant = modifier.substr(sep + 1).as_string(); | 82 out_platform->variant = modifier.substr(sep + 1).as_string(); |
| 85 } | 83 } |
| 86 | 84 |
| 87 return IsValidPlatform(out_platform); | 85 return IsValidPlatform(out_platform); |
| 88 } | 86 } |
| 89 | 87 |
| 90 Platform GetCurrentPlatform() { | 88 Platform GetCurrentPlatform() { |
| 91 Platform platform; | 89 Platform platform; |
| 92 #if defined(OS_WIN) | 90 #if defined(OS_IOS) |
| 93 platform.name = "Win"; | |
| 94 base::win::Version version = base::win::GetVersion(); | |
| 95 if (version == base::win::VERSION_XP) | |
| 96 platform.variant = "XP"; | |
| 97 else if (version == base::win::VERSION_VISTA) | |
| 98 platform.variant = "Vista"; | |
| 99 else if (version == base::win::VERSION_WIN7) | |
| 100 platform.variant = "7"; | |
| 101 else if (version == base::win::VERSION_WIN8) | |
| 102 platform.variant = "8"; | |
| 103 #elif defined(OS_IOS) | |
| 104 platform.name = "iOS"; | 91 platform.name = "iOS"; |
| 105 #elif defined(OS_MACOSX) | 92 #elif defined(OS_MACOSX) |
| 106 platform.name = "Mac"; | 93 platform.name = "Mac"; |
| 107 if (base::mac::IsOSSnowLeopard()) | 94 if (base::mac::IsOSSnowLeopard()) |
| 108 platform.variant = "10.6"; | 95 platform.variant = "10.6"; |
| 109 else if (base::mac::IsOSLion()) | 96 else if (base::mac::IsOSLion()) |
| 110 platform.variant = "10.7"; | 97 platform.variant = "10.7"; |
| 111 else if (base::mac::IsOSMountainLion()) | 98 else if (base::mac::IsOSMountainLion()) |
| 112 platform.variant = "10.8"; | 99 platform.variant = "10.8"; |
| 113 else if (base::mac::IsOSMavericks()) | 100 else if (base::mac::IsOSMavericks()) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 139 } |
| 153 | 140 |
| 154 Expectation::Expectation() | 141 Expectation::Expectation() |
| 155 : configuration(CONFIGURATION_UNSPECIFIED), | 142 : configuration(CONFIGURATION_UNSPECIFIED), |
| 156 result(RESULT_PASS) { | 143 result(RESULT_PASS) { |
| 157 } | 144 } |
| 158 | 145 |
| 159 Expectation::~Expectation() {} | 146 Expectation::~Expectation() {} |
| 160 | 147 |
| 161 } // namespace test_expectations | 148 } // namespace test_expectations |
| OLD | NEW |