OLD | NEW |
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 Loading... |
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 |
OLD | NEW |