summaryrefslogtreecommitdiff
path: root/base/sys_info_unittest.cc
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@google.com>2016-01-15 13:02:14 -0800
committerAlex Vakulenko <avakulenko@google.com>2016-01-20 14:42:17 -0800
commit0d205d712abd16eeed2f5d5b1052a367d23a223f (patch)
treeb41d6d907d8b307da68edf5d905d2660d1f3a19c /base/sys_info_unittest.cc
parentb7972fa941a92a43e7ed703ab262afeb7bcc2a5a (diff)
downloadlibchrome-0d205d712abd16eeed2f5d5b1052a367d23a223f.tar.gz
libchrome: Uprev the library to r369476 from Chromium
Pulled the latest and greatest version of libchrome from Chromium. The merge was done against r369476 which corresponds to git commit 0471d0e2e2ef4a544a63481a389e1df33ea7c00a of Jan 14, 2016 Notable changes are: - base::scoped_ptr<T> is now almost identical to std::unique_ptr<T> No Pass() method, now std::move() is used on scoped pointers - basictypes.h is removed and custom int types such as int32 are now replaced with the standard int32_t and similar from <stdint.h> - String utility functions are cleaned up/refactored. Now all are in base:: namespace, many now return values rather than take pointers for results, ambiguous Booleans are replaced with enums, such as: base::StartsWithASCII(current_url, "https://", false); now is: base::StartsWith(current_url, "https://", base::CompareCase::INSENSITIVE_ASCII); - COMPILE_ASSERT() is now replaced with standard static_assert() - Numeric range constants such as kuint64max are removed in favor of standard <limits> constructs such as std::numeric_limits<uint64_t>::max() - base::Value and derived classes use scoped_ptr<> more and support for raw pointers to base::Value is deprecated and/or removed in many places. - base::MessageLoopProxy is completely removed (was marked deprecated before) - base::MessageLoop::Quit() and QuitClosure are renamed to QuitWhenIdle and QuitWhenIdleClosure for more semantic clarity. Change-Id: I1f5436d253a0a32b2299160a76993752d818736f
Diffstat (limited to 'base/sys_info_unittest.cc')
-rw-r--r--base/sys_info_unittest.cc35
1 files changed, 19 insertions, 16 deletions
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc
index 15ae0989b1..3f284ba868 100644
--- a/base/sys_info_unittest.cc
+++ b/base/sys_info_unittest.cc
@@ -2,11 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdint.h>
+
#include "base/environment.h"
#include "base/files/file_util.h"
#include "base/sys_info.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
+#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -43,9 +46,9 @@ TEST_F(SysInfoTest, AmountOfFreeDiskSpace) {
#if defined(OS_WIN) || defined(OS_MACOSX)
TEST_F(SysInfoTest, OperatingSystemVersionNumbers) {
- int32 os_major_version = -1;
- int32 os_minor_version = -1;
- int32 os_bugfix_version = -1;
+ int32_t os_major_version = -1;
+ int32_t os_minor_version = -1;
+ int32_t os_bugfix_version = -1;
base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
&os_minor_version,
&os_bugfix_version);
@@ -56,13 +59,13 @@ TEST_F(SysInfoTest, OperatingSystemVersionNumbers) {
#endif
TEST_F(SysInfoTest, Uptime) {
- int64 up_time_1 = base::SysInfo::Uptime();
+ base::TimeDelta up_time_1 = base::SysInfo::Uptime();
// UpTime() is implemented internally using TimeTicks::Now(), which documents
// system resolution as being 1-15ms. Sleep a little longer than that.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(20));
- int64 up_time_2 = base::SysInfo::Uptime();
- EXPECT_GT(up_time_1, 0);
- EXPECT_GT(up_time_2, up_time_1);
+ base::TimeDelta up_time_2 = base::SysInfo::Uptime();
+ EXPECT_GT(up_time_1.InMicroseconds(), 0);
+ EXPECT_GT(up_time_2.InMicroseconds(), up_time_1.InMicroseconds());
}
#if defined(OS_MACOSX) && !defined(OS_IOS)
@@ -75,9 +78,9 @@ TEST_F(SysInfoTest, HardwareModelName) {
#if defined(OS_CHROMEOS)
TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) {
- int32 os_major_version = -1;
- int32 os_minor_version = -1;
- int32 os_bugfix_version = -1;
+ int32_t os_major_version = -1;
+ int32_t os_minor_version = -1;
+ int32_t os_bugfix_version = -1;
const char kLsbRelease[] =
"FOO=1234123.34.5\n"
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
@@ -91,9 +94,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) {
}
TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
- int32 os_major_version = -1;
- int32 os_minor_version = -1;
- int32 os_bugfix_version = -1;
+ int32_t os_major_version = -1;
+ int32_t os_minor_version = -1;
+ int32_t os_bugfix_version = -1;
const char kLsbRelease[] =
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n"
"FOO=1234123.34.5\n";
@@ -107,9 +110,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
}
TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) {
- int32 os_major_version = -1;
- int32 os_minor_version = -1;
- int32 os_bugfix_version = -1;
+ int32_t os_major_version = -1;
+ int32_t os_minor_version = -1;
+ int32_t os_bugfix_version = -1;
const char kLsbRelease[] = "FOO=1234123.34.5\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,