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

Unified Diff: base/sys_info_unittest.cc

Issue 999623002: metrics/base: log whether drives have seek penalties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: indent Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: base/sys_info_unittest.cc
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc
index 15ae0989b1d7d4590c1cf5570a980fa901d1e1df..47ac6af85f676b6659c7e65f8d1ddb0819c2dec1 100644
--- a/base/sys_info_unittest.cc
+++ b/base/sys_info_unittest.cc
@@ -10,6 +10,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
typedef PlatformTest SysInfoTest;
using base::FilePath;
@@ -41,6 +45,19 @@ TEST_F(SysInfoTest, AmountOfFreeDiskSpace) {
<< tmp_path.value();
}
+TEST_F(SysInfoTest, HasSeekPenalty) {
+ FilePath tmp_path;
+ ASSERT_TRUE(base::GetTempDir(&tmp_path));
+
+ bool unused;
+ bool success = base::SysInfo::HasSeekPenalty(tmp_path, &unused);
+#if defined(OS_WIN)
+ EXPECT_EQ(base::win::GetVersion() >= base::win::VERSION_WIN7, success);
+#else
+ EXPECT_FALSE(success) << "Update if this gets implemented elsewhere.";
+#endif
+}
+
#if defined(OS_WIN) || defined(OS_MACOSX)
TEST_F(SysInfoTest, OperatingSystemVersionNumbers) {
int32 os_major_version = -1;

Powered by Google App Engine
This is Rietveld 408576698