OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) { | 23 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) { |
24 // We aren't actually testing that it's correct, just that it's sane. | 24 // We aren't actually testing that it's correct, just that it's sane. |
25 FilePath tmp_path; | 25 FilePath tmp_path; |
26 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); | 26 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); |
27 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0) | 27 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0) |
28 << tmp_path.value(); | 28 << tmp_path.value(); |
29 } | 29 } |
30 | 30 |
31 TEST_F(SysInfoTest, GetEnvVar) { | |
32 // Every setup should have non-empty PATH... | |
33 EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L""); | |
34 } | |
35 | |
36 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 31 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
37 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { | 32 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { |
38 int32 os_major_version = -1; | 33 int32 os_major_version = -1; |
39 int32 os_minor_version = -1; | 34 int32 os_minor_version = -1; |
40 int32 os_bugfix_version = -1; | 35 int32 os_bugfix_version = -1; |
41 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, | 36 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
42 &os_minor_version, | 37 &os_minor_version, |
43 &os_bugfix_version); | 38 &os_bugfix_version); |
44 EXPECT_GT(os_major_version, -1); | 39 EXPECT_GT(os_major_version, -1); |
45 EXPECT_GT(os_minor_version, -1); | 40 EXPECT_GT(os_minor_version, -1); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 base::SysInfo::ParseLsbRelease(lsb_release, | 96 base::SysInfo::ParseLsbRelease(lsb_release, |
102 &os_major_version, | 97 &os_major_version, |
103 &os_minor_version, | 98 &os_minor_version, |
104 &os_bugfix_version); | 99 &os_bugfix_version); |
105 EXPECT_EQ(-1, os_major_version); | 100 EXPECT_EQ(-1, os_major_version); |
106 EXPECT_EQ(-1, os_minor_version); | 101 EXPECT_EQ(-1, os_minor_version); |
107 EXPECT_EQ(-1, os_bugfix_version); | 102 EXPECT_EQ(-1, os_bugfix_version); |
108 } | 103 } |
109 | 104 |
110 #endif // OS_CHROMEOS | 105 #endif // OS_CHROMEOS |
OLD | NEW |