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_SCOPED_FAKE_NSWINDOW_FOCUS_H_
6 #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
8 #include "base/memory/scoped_ptr.h"
12 class ScopedObjCClassSwizzler
;
19 // Simulates key and main status by listening for -makeKeyWindow and
20 // -makeMainWindow. This allows test coverage of code relying on window focus
21 // changes without resorting to an interactive_ui_test.
22 class ScopedFakeNSWindowFocus
{
24 ScopedFakeNSWindowFocus();
25 ~ScopedFakeNSWindowFocus();
28 scoped_ptr
<base::mac::ScopedObjCClassSwizzler
> is_main_swizzler_
;
29 scoped_ptr
<base::mac::ScopedObjCClassSwizzler
> make_main_swizzler_
;
30 scoped_ptr
<base::mac::ScopedObjCClassSwizzler
> is_key_swizzler_
;
31 scoped_ptr
<base::mac::ScopedObjCClassSwizzler
> make_key_swizzler_
;
33 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFocus
);
39 #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_