| Index: base/test/expectations/expectation.cc
|
| diff --git a/base/test/expectations/expectation.cc b/base/test/expectations/expectation.cc
|
| index 5baf04f7c67f4d7c8656832ccbc9bee13d3d2340..31a387eba3e2354e80da7f8a6a7005296cc919a8 100644
|
| --- a/base/test/expectations/expectation.cc
|
| +++ b/base/test/expectations/expectation.cc
|
| @@ -4,6 +4,16 @@
|
|
|
| #include "base/test/expectations/expectation.h"
|
|
|
| +#include "base/logging.h"
|
| +
|
| +#if defined(OS_WIN)
|
| +#include "base/win/windows_version.h"
|
| +#elif defined(OS_MACOSX) && !defined(OS_IOS)
|
| +#include "base/mac/mac_util.h"
|
| +#elif defined(OS_LINUX)
|
| +#include "base/sys_info.h"
|
| +#endif
|
| +
|
| namespace test_expectations {
|
|
|
| bool ResultFromString(const base::StringPiece& result, Result* out_result) {
|
| @@ -44,8 +54,8 @@ static bool IsValidPlatform(const Platform* platform) {
|
| }
|
| } else if (name == "Linux") {
|
| if (variant != "" &&
|
| - variant != "x32" &&
|
| - variant != "x64") {
|
| + variant != "32" &&
|
| + variant != "64") {
|
| return false;
|
| }
|
| } else if (name == "ChromeOS") {
|
| @@ -75,6 +85,46 @@ bool PlatformFromString(const base::StringPiece& modifier,
|
| return IsValidPlatform(out_platform);
|
| }
|
|
|
| +Platform GetCurrentPlatform() {
|
| + Platform platform;
|
| +#if defined(OS_WIN)
|
| + platform.name = "Win";
|
| + base::win::Version version = base::win::GetVersion();
|
| + if (version == base::win::VERSION_XP)
|
| + platform.variant = "XP";
|
| + else if (version == base::win::VERSION_VISTA)
|
| + platform.variant = "Vista";
|
| + else if (version == base::win::VERSION_WIN7)
|
| + platform.variant = "7";
|
| + else if (version == base::win::VERSION_WIN8)
|
| + platform.variant = "8";
|
| +#elif defined(OS_IOS)
|
| + platform.name = "iOS";
|
| +#elif defined(OS_MACOSX)
|
| + platform.name = "Mac";
|
| + if (base::mac::IsOSSnowLeopard())
|
| + platform.variant = "10.6";
|
| + else if (base::mac::IsOSLion())
|
| + platform.variant = "10.7";
|
| + else if (base::mac::IsOSMountainLion())
|
| + platform.variant = "10.8";
|
| +#elif defined(OS_CHROMEOS)
|
| + platform.name = "ChromeOS";
|
| +#elif defined(OS_ANDROID)
|
| + platform.name = "Android";
|
| +#elif defined(OS_LINUX)
|
| + platform.name = "Linux";
|
| + std::string arch = base::SysInfo::OperatingSystemArchitecture();
|
| + if (arch == "x86")
|
| + platform.variant = "32";
|
| + else if (arch == "x86_64")
|
| + platform.variant = "64";
|
| +#else
|
| + NOTREACHED();
|
| +#endif
|
| + return platform;
|
| +}
|
| +
|
| bool ConfigurationFromString(const base::StringPiece& modifier,
|
| Configuration* out_configuration) {
|
| if (modifier == "Debug")
|
| @@ -87,6 +137,16 @@ bool ConfigurationFromString(const base::StringPiece& modifier,
|
| return true;
|
| }
|
|
|
| +Configuration GetCurrentConfiguration() {
|
| +#if NDEBUG
|
| + return CONFIGURATION_RELEASE;
|
| +#else
|
| + return CONFIGURATION_DEBUG;
|
| +#endif
|
| + NOTREACHED();
|
| + return CONFIGURATION_UNSPECIFIED;
|
| +}
|
| +
|
| Expectation::Expectation()
|
| : configuration(CONFIGURATION_UNSPECIFIED),
|
| result(RESULT_PASS) {
|
|
|