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

Side by Side Diff: base/sys_info_unittest.cc

Issue 2860663005: Implement SysInfo::HardwareModelName() on iOS. (Closed)
Patch Set: Enable HardwareModelName test on iOS. Created 3 years, 7 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 unified diff | Download patch
« base/sys_info_ios.mm ('K') | « base/sys_info_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/process/process_metrics.h" 9 #include "base/process/process_metrics.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 TEST_F(SysInfoTest, Uptime) { 88 TEST_F(SysInfoTest, Uptime) {
89 TimeDelta up_time_1 = SysInfo::Uptime(); 89 TimeDelta up_time_1 = SysInfo::Uptime();
90 // UpTime() is implemented internally using TimeTicks::Now(), which documents 90 // UpTime() is implemented internally using TimeTicks::Now(), which documents
91 // system resolution as being 1-15ms. Sleep a little longer than that. 91 // system resolution as being 1-15ms. Sleep a little longer than that.
92 PlatformThread::Sleep(TimeDelta::FromMilliseconds(20)); 92 PlatformThread::Sleep(TimeDelta::FromMilliseconds(20));
93 TimeDelta up_time_2 = SysInfo::Uptime(); 93 TimeDelta up_time_2 = SysInfo::Uptime();
94 EXPECT_GT(up_time_1.InMicroseconds(), 0); 94 EXPECT_GT(up_time_1.InMicroseconds(), 0);
95 EXPECT_GT(up_time_2.InMicroseconds(), up_time_1.InMicroseconds()); 95 EXPECT_GT(up_time_2.InMicroseconds(), up_time_1.InMicroseconds());
96 } 96 }
97 97
98 #if defined(OS_MACOSX) && !defined(OS_IOS) 98 #if defined(OS_MACOSX)
99 TEST_F(SysInfoTest, HardwareModelName) { 99 TEST_F(SysInfoTest, HardwareModelName) {
100 std::string hardware_model = SysInfo::HardwareModelName(); 100 std::string hardware_model = SysInfo::HardwareModelName();
101 EXPECT_FALSE(hardware_model.empty()); 101 EXPECT_FALSE(hardware_model.empty());
102 } 102 }
103 #endif 103 #endif
104 104
105 #if defined(OS_CHROMEOS) 105 #if defined(OS_CHROMEOS)
106 106
107 TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) { 107 TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) {
108 int32_t os_major_version = -1; 108 int32_t os_major_version = -1;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard()); 188 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard());
189 189
190 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys"; 190 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys";
191 SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, Time()); 191 SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, Time());
192 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard()); 192 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard());
193 } 193 }
194 194
195 #endif // OS_CHROMEOS 195 #endif // OS_CHROMEOS
196 196
197 } // namespace base 197 } // namespace base
OLDNEW
« base/sys_info_ios.mm ('K') | « base/sys_info_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698