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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 int32 os_bugfix_version = -1; | 45 int32 os_bugfix_version = -1; |
46 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, | 46 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
47 &os_minor_version, | 47 &os_minor_version, |
48 &os_bugfix_version); | 48 &os_bugfix_version); |
49 EXPECT_GT(os_major_version, -1); | 49 EXPECT_GT(os_major_version, -1); |
50 EXPECT_GT(os_minor_version, -1); | 50 EXPECT_GT(os_minor_version, -1); |
51 EXPECT_GT(os_bugfix_version, -1); | 51 EXPECT_GT(os_bugfix_version, -1); |
52 } | 52 } |
53 #endif | 53 #endif |
54 | 54 |
| 55 TEST_F(SysInfoTest, GetPrimaryDisplayDimensions) { |
| 56 // We aren't actually testing that it's correct, just that it's sane. |
| 57 int width, height; |
| 58 base::SysInfo::GetPrimaryDisplayDimensions(&width, &height); |
| 59 EXPECT_GE(width, 10); |
| 60 EXPECT_GE(height, 10); |
| 61 } |
| 62 |
| 63 TEST_F(SysInfoTest, DisplayCount) { |
| 64 // We aren't actually testing that it's correct, just that it's sane. |
| 65 EXPECT_GE(base::SysInfo::DisplayCount(), 1); |
| 66 } |
| 67 |
55 #if defined(OS_CHROMEOS) | 68 #if defined(OS_CHROMEOS) |
56 TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) { | 69 TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) { |
57 int32 os_major_version = -1; | 70 int32 os_major_version = -1; |
58 int32 os_minor_version = -1; | 71 int32 os_minor_version = -1; |
59 int32 os_bugfix_version = -1; | 72 int32 os_bugfix_version = -1; |
60 std::string lsb_release("FOO=1234123.34.5\n"); | 73 std::string lsb_release("FOO=1234123.34.5\n"); |
61 lsb_release.append(base::SysInfo::GetLinuxStandardBaseVersionKey()); | 74 lsb_release.append(base::SysInfo::GetLinuxStandardBaseVersionKey()); |
62 lsb_release.append("=1.2.3.4\n"); | 75 lsb_release.append("=1.2.3.4\n"); |
63 base::SysInfo::ParseLsbRelease(lsb_release, | 76 base::SysInfo::ParseLsbRelease(lsb_release, |
64 &os_major_version, | 77 &os_major_version, |
(...skipping 28 matching lines...) Expand all Loading... |
93 base::SysInfo::ParseLsbRelease(lsb_release, | 106 base::SysInfo::ParseLsbRelease(lsb_release, |
94 &os_major_version, | 107 &os_major_version, |
95 &os_minor_version, | 108 &os_minor_version, |
96 &os_bugfix_version); | 109 &os_bugfix_version); |
97 EXPECT_EQ(os_major_version, -1); | 110 EXPECT_EQ(os_major_version, -1); |
98 EXPECT_EQ(os_minor_version, -1); | 111 EXPECT_EQ(os_minor_version, -1); |
99 EXPECT_EQ(os_bugfix_version, -1); | 112 EXPECT_EQ(os_bugfix_version, -1); |
100 } | 113 } |
101 | 114 |
102 #endif // OS_CHROMEOS | 115 #endif // OS_CHROMEOS |
OLD | NEW |