scoped_running_on_chromeos.h 827 B

12345678910111213141516171819202122232425
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_TEST_SCOPED_RUNNING_ON_CHROMEOS_H_
  5. #define BASE_TEST_SCOPED_RUNNING_ON_CHROMEOS_H_
  6. namespace base {
  7. namespace test {
  8. // Test helper that forces base::SysInfo::IsRunningOnChromeOS() to return true.
  9. // NOTE: Must be created on the main thread before any other threads are
  10. // started. Cannot be nested.
  11. class ScopedRunningOnChromeOS {
  12. public:
  13. ScopedRunningOnChromeOS();
  14. ScopedRunningOnChromeOS(const ScopedRunningOnChromeOS&) = delete;
  15. ScopedRunningOnChromeOS& operator=(const ScopedRunningOnChromeOS&) = delete;
  16. ~ScopedRunningOnChromeOS();
  17. };
  18. } // namespace test
  19. } // namespace base
  20. #endif // BASE_TEST_SCOPED_RUNNING_ON_CHROMEOS_H_