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

Side by Side Diff: base/sys_info_unittest.cc

Issue 2489853002: Added function to provide the short board name of the device (Closed)
Patch Set: Nit Created 4 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
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | components/metrics/drive_metrics_provider_linux.cc » ('j') | 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/sys_info.h" 9 #include "base/sys_info.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 "CHROMEOS_RELEASE_VERSION=1.2.3.4\n"; 149 "CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
150 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); 150 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time());
151 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); 151 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
152 152
153 const char kLsbRelease3[] = 153 const char kLsbRelease3[] =
154 "CHROMEOS_RELEASE_NAME=Chromium OS\n"; 154 "CHROMEOS_RELEASE_NAME=Chromium OS\n";
155 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time()); 155 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time());
156 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); 156 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
157 } 157 }
158 158
159 TEST_F(SysInfoTest, GetStrippedReleaseBoard) {
160 const char* kLsbRelease1 = "CHROMEOS_RELEASE_BOARD=Glimmer\n";
161 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease1, base::Time());
162 EXPECT_EQ("glimmer", base::SysInfo::GetStrippedReleaseBoard());
163
164 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys";
165 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time());
166 EXPECT_EQ("glimmer", base::SysInfo::GetStrippedReleaseBoard());
167 }
168
159 #endif // OS_CHROMEOS 169 #endif // OS_CHROMEOS
OLDNEW
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | components/metrics/drive_metrics_provider_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698