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 <string_view> 8 9 #include "base/system/sys_info.h" 10 11 namespace base { 12 namespace test { 13 ScopedChromeOSVersionInfo(std::string_view lsb_release,Time lsb_release_time)14ScopedChromeOSVersionInfo::ScopedChromeOSVersionInfo( 15 std::string_view lsb_release, 16 Time lsb_release_time) { 17 SysInfo::SetChromeOSVersionInfoForTest(std::string(lsb_release), 18 lsb_release_time); 19 } 20 ~ScopedChromeOSVersionInfo()21ScopedChromeOSVersionInfo::~ScopedChromeOSVersionInfo() { 22 SysInfo::ResetChromeOSVersionInfoForTest(); 23 } 24 25 } // namespace test 26 } // namespace base 27