Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: ui/base/test/scoped_fake_nswindow_focus.h

Issue 1268293002: [MacViews] Fix AccessiblePaneViewTest.SetPaneFocusAndRestore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove roque delta. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/test/scoped_fake_nswindow_focus.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/test/scoped_fake_nswindow_focus.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698