1 // Copyright 2020 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/test/scoped_chromeos_version_info.h" 6 7 #include "base/strings/string_piece.h" 8 #include "base/system/sys_info.h" 9 10 namespace base { 11 namespace test { 12 ScopedChromeOSVersionInfo(StringPiece lsb_release,Time lsb_release_time)13ScopedChromeOSVersionInfo::ScopedChromeOSVersionInfo(StringPiece lsb_release, 14 Time lsb_release_time) { 15 SysInfo::SetChromeOSVersionInfoForTest(std::string(lsb_release), 16 lsb_release_time); 17 } 18 ~ScopedChromeOSVersionInfo()19ScopedChromeOSVersionInfo::~ScopedChromeOSVersionInfo() { 20 SysInfo::ResetChromeOSVersionInfoForTest(); 21 } 22 23 } // namespace test 24 } // namespace base 25