| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_ | 5 #ifndef UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_ |
| 6 #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_ | 6 #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 namespace test { | 13 namespace test { |
| 14 | 14 |
| 15 // Simulates fullscreen transitions on NSWindows. This allows testing fullscreen | 15 // Simulates fullscreen transitions on NSWindows. This allows testing fullscreen |
| 16 // logic without relying on the OS's fullscreen behavior as that tends to be | 16 // logic without relying on the OS's fullscreen behavior as that tends to be |
| 17 // flaky, even in interactive tests. We only allow one NSWindow per process to | 17 // flaky, even in interactive tests. We only allow one NSWindow per process to |
| 18 // be fullscreen at a time, which should be sufficient for tests. | 18 // be fullscreen at a time, which should be sufficient for tests. |
| 19 class ScopedFakeNSWindowFullscreen { | 19 class ScopedFakeNSWindowFullscreen { |
| 20 public: | 20 public: |
| 21 // Impl class to hide Obj-C implementation from this header. | 21 // Impl class to hide Obj-C implementation from this header. |
| 22 class Impl; | 22 class Impl; |
| 23 | 23 |
| 24 ScopedFakeNSWindowFullscreen(); | 24 ScopedFakeNSWindowFullscreen(); |
| 25 ~ScopedFakeNSWindowFullscreen(); | 25 ~ScopedFakeNSWindowFullscreen(); |
| 26 | 26 |
| 27 // Wait for any transition in progress to complete. |
| 28 void FinishTransition(); |
| 29 |
| 27 private: | 30 private: |
| 28 std::unique_ptr<Impl> impl_; | 31 std::unique_ptr<Impl> impl_; |
| 29 | 32 |
| 30 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFullscreen); | 33 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFullscreen); |
| 31 }; | 34 }; |
| 32 | 35 |
| 33 } // namespace test | 36 } // namespace test |
| 34 } // namespace ui | 37 } // namespace ui |
| 35 | 38 |
| 36 #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_ | 39 #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FULLSCREEN_H_ |
| OLD | NEW |