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 #ifndef BASE_TEST_SCOPED_RUNNING_ON_CHROMEOS_H_ 6 #define BASE_TEST_SCOPED_RUNNING_ON_CHROMEOS_H_ 7 8 namespace base { 9 namespace test { 10 11 // Test helper that forces base::SysInfo::IsRunningOnChromeOS() to return true. 12 // NOTE: Must be created on the main thread before any other threads are 13 // started. Cannot be nested. 14 class ScopedRunningOnChromeOS { 15 public: 16 ScopedRunningOnChromeOS(); 17 ScopedRunningOnChromeOS(const ScopedRunningOnChromeOS&) = delete; 18 ScopedRunningOnChromeOS& operator=(const ScopedRunningOnChromeOS&) = delete; 19 ~ScopedRunningOnChromeOS(); 20 }; 21 22 } // namespace test 23 } // namespace base 24 25 #endif // BASE_TEST_SCOPED_RUNNING_ON_CHROMEOS_H_ 26