Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: base/sys_info_unittest.cc

Issue 93263002: Move some more file utils to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/environment.h" 5 #include "base/environment.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/sys_info.h" 7 #include "base/sys_info.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 16 matching lines...) Expand all
27 27
28 TEST_F(SysInfoTest, AmountOfMem) { 28 TEST_F(SysInfoTest, AmountOfMem) {
29 // We aren't actually testing that it's correct, just that it's sane. 29 // We aren't actually testing that it's correct, just that it's sane.
30 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); 30 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0);
31 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); 31 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0);
32 } 32 }
33 33
34 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) { 34 TEST_F(SysInfoTest, AmountOfFreeDiskSpace) {
35 // We aren't actually testing that it's correct, just that it's sane. 35 // We aren't actually testing that it's correct, just that it's sane.
36 FilePath tmp_path; 36 FilePath tmp_path;
37 ASSERT_TRUE(file_util::GetTempDir(&tmp_path)); 37 ASSERT_TRUE(base::GetTempDir(&tmp_path));
38 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0) 38 EXPECT_GT(base::SysInfo::AmountOfFreeDiskSpace(tmp_path), 0)
39 << tmp_path.value(); 39 << tmp_path.value();
40 } 40 }
41 41
42 #if defined(OS_WIN) || defined(OS_MACOSX) 42 #if defined(OS_WIN) || defined(OS_MACOSX)
43 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { 43 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) {
44 int32 os_major_version = -1; 44 int32 os_major_version = -1;
45 int32 os_minor_version = -1; 45 int32 os_minor_version = -1;
46 int32 os_bugfix_version = -1; 46 int32 os_bugfix_version = -1;
47 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, 47 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); 137 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time());
138 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); 138 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
139 139
140 const char* kLsbRelease3 = 140 const char* kLsbRelease3 =
141 "CHROMEOS_RELEASE_NAME=Chromium OS\n"; 141 "CHROMEOS_RELEASE_NAME=Chromium OS\n";
142 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time()); 142 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time());
143 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); 143 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
144 } 144 }
145 145
146 #endif // OS_CHROMEOS 146 #endif // OS_CHROMEOS
OLDNEW
« no previous file with comments | « base/os_compat_android_unittest.cc ('k') | chrome/browser/chromeos/drive/file_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698