| Index: ui/base/test/scoped_fake_nswindow_focus.h
|
| diff --git a/chrome/browser/ui/test/scoped_fake_nswindow_main_status.h b/ui/base/test/scoped_fake_nswindow_focus.h
|
| similarity index 26%
|
| rename from chrome/browser/ui/test/scoped_fake_nswindow_main_status.h
|
| rename to ui/base/test/scoped_fake_nswindow_focus.h
|
| index 0d4df98e61525a1931863516c289786261830b88..aafd715afb89c1690a2d929714fd9ce308694c48 100644
|
| --- a/chrome/browser/ui/test/scoped_fake_nswindow_main_status.h
|
| +++ b/ui/base/test/scoped_fake_nswindow_focus.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_UI_TEST_SCOPED_FAKE_NSWINDOW_MAIN_STATUS_H_
|
| -#define CHROME_BROWSER_UI_TEST_SCOPED_FAKE_NSWINDOW_MAIN_STATUS_H_
|
| +#ifndef UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
|
| +#define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
|
|
|
| #include "base/memory/scoped_ptr.h"
|
|
|
| @@ -13,20 +13,27 @@ class ScopedObjCClassSwizzler;
|
| }
|
| }
|
|
|
| -@class NSWindow;
|
| +namespace ui {
|
| +namespace test {
|
|
|
| -// Simulates a particular NSWindow to report YES for [NSWindow isMainWindow].
|
| -// This allows test coverage of code relying on window focus changes without
|
| -// resorting to an interactive_ui_test.
|
| -class ScopedFakeNSWindowMainStatus {
|
| +// Simulates key and main status by listening for -makeKeyWindow and
|
| +// -makeMainWindow. This allows test coverage of code relying on window focus
|
| +// changes without resorting to an interactive_ui_test.
|
| +class ScopedFakeNSWindowFocus {
|
| public:
|
| - explicit ScopedFakeNSWindowMainStatus(NSWindow* window);
|
| - ~ScopedFakeNSWindowMainStatus();
|
| + ScopedFakeNSWindowFocus();
|
| + ~ScopedFakeNSWindowFocus();
|
|
|
| private:
|
| - scoped_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_;
|
| + scoped_ptr<base::mac::ScopedObjCClassSwizzler> is_main_swizzler_;
|
| + scoped_ptr<base::mac::ScopedObjCClassSwizzler> make_main_swizzler_;
|
| + scoped_ptr<base::mac::ScopedObjCClassSwizzler> is_key_swizzler_;
|
| + scoped_ptr<base::mac::ScopedObjCClassSwizzler> make_key_swizzler_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowMainStatus);
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFocus);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_UI_TEST_SCOPED_FAKE_NSWINDOW_MAIN_STATUS_H_
|
| +} // namespace test
|
| +} // namespace ui
|
| +
|
| +#endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
|
|
|