scoped_fake_nswindow_fullscreen.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2015 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 UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_
  5. #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_
  6. namespace ui {
  7. namespace test {
  8. // Simulates fullscreen transitions on NSWindows. This allows testing fullscreen
  9. // logic without relying on the OS's fullscreen behavior as that tends to be
  10. // flaky, even in interactive tests. We only allow one NSWindow per process to
  11. // be fullscreen at a time, which should be sufficient for tests.
  12. class ScopedFakeNSWindowFullscreen {
  13. public:
  14. // Impl class to hide Obj-C implementation from this header.
  15. class Impl;
  16. ScopedFakeNSWindowFullscreen();
  17. ScopedFakeNSWindowFullscreen(const ScopedFakeNSWindowFullscreen&) = delete;
  18. ScopedFakeNSWindowFullscreen& operator=(const ScopedFakeNSWindowFullscreen&) =
  19. delete;
  20. ~ScopedFakeNSWindowFullscreen();
  21. private:
  22. static int instance_count_;
  23. };
  24. } // namespace test
  25. } // namespace ui
  26. #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_