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.
5 #ifndef UI_BASE_TEST_NSWINDOW_FULLSCREEN_NOTIFICATION_WAITER_H_
6 #define UI_BASE_TEST_NSWINDOW_FULLSCREEN_NOTIFICATION_WAITER_H_
8 #import <Cocoa/Cocoa.h>
10 #import "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/run_loop.h"
14 // Waits for fullscreen transitions to complete.
15 @interface NSWindowFullscreenNotificationWaiter
: NSObject
{
17 scoped_ptr
<base::RunLoop
> runLoop_
;
18 base::scoped_nsobject
<NSWindow
> window_
;
21 int targetEnterCount_
;
25 @
property(readonly
, nonatomic
) int enterCount
;
26 @
property(readonly
, nonatomic
) int exitCount
;
28 // Initialize for the given window and start tracking notifications.
29 - (id
)initWithWindow
:(NSWindow
*)window
;
31 // Keep spinning a run loop until the enter and exit counts match.
32 - (void)waitForEnterCount
:(int)enterCount exitCount
:(int)exitCount
;
36 #endif // UI_BASE_TEST_NSWINDOW_FULLSCREEN_NOTIFICATION_WAITER_H_