| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/sys_info.h" | 6 #include "base/sys_info.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "testing/platform_test.h" | 8 #include "testing/platform_test.h" |
| 9 | 9 |
| 10 typedef PlatformTest SysInfoTest; | 10 typedef PlatformTest SysInfoTest; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 TEST_F(SysInfoTest, GetEnvVar) { | 30 TEST_F(SysInfoTest, GetEnvVar) { |
| 31 // Every setup should have non-empty PATH... | 31 // Every setup should have non-empty PATH... |
| 32 EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L""); | 32 EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L""); |
| 33 } | 33 } |
| 34 | 34 |
| 35 TEST_F(SysInfoTest, HasEnvVar) { | 35 TEST_F(SysInfoTest, HasEnvVar) { |
| 36 // Every setup should have PATH... | 36 // Every setup should have PATH... |
| 37 EXPECT_TRUE(base::SysInfo::HasEnvVar(L"PATH")); | 37 EXPECT_TRUE(base::SysInfo::HasEnvVar(L"PATH")); |
| 38 } | 38 } |
| 39 |
| 40 // TODO(port): If and when there's a LINUX version of this method, enable this |
| 41 // unit test. |
| 42 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 43 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { |
| 44 int32 os_major_version = -1; |
| 45 int32 os_minor_version = -1; |
| 46 int32 os_bugfix_version = -1; |
| 47 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
| 48 &os_minor_version, |
| 49 &os_bugfix_version); |
| 50 EXPECT_GT(os_major_version, 0); |
| 51 EXPECT_GT(os_minor_version, 0); |
| 52 EXPECT_GT(os_bugfix_version, 0); |
| 53 } |
| 54 #endif // OS_WIN || OS_MACOSX |
| OLD | NEW |