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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CHROME_BROWSER_UI_TEST_SCOPED_FAKE_NSWINDOW_MAIN_STATUS_H_ 5 #ifndef UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
6 #define CHROME_BROWSER_UI_TEST_SCOPED_FAKE_NSWINDOW_MAIN_STATUS_H_ 6 #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 9
10 namespace base { 10 namespace base {
11 namespace mac { 11 namespace mac {
12 class ScopedObjCClassSwizzler; 12 class ScopedObjCClassSwizzler;
13 } 13 }
14 } 14 }
15 15
16 @class NSWindow; 16 namespace ui {
17 namespace test {
17 18
18 // Simulates a particular NSWindow to report YES for [NSWindow isMainWindow]. 19 // Simulates key and main status by listening for -makeKeyWindow and
19 // This allows test coverage of code relying on window focus changes without 20 // -makeMainWindow. This allows test coverage of code relying on window focus
20 // resorting to an interactive_ui_test. 21 // changes without resorting to an interactive_ui_test.
21 class ScopedFakeNSWindowMainStatus { 22 class ScopedFakeNSWindowFocus {
22 public: 23 public:
23 explicit ScopedFakeNSWindowMainStatus(NSWindow* window); 24 ScopedFakeNSWindowFocus();
24 ~ScopedFakeNSWindowMainStatus(); 25 ~ScopedFakeNSWindowFocus();
25 26
26 private: 27 private:
27 scoped_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_; 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_;
28 32
29 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowMainStatus); 33 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFocus);
30 }; 34 };
31 35
32 #endif // CHROME_BROWSER_UI_TEST_SCOPED_FAKE_NSWINDOW_MAIN_STATUS_H_ 36 } // namespace test
37 } // namespace ui
38
39 #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
OLDNEW
« 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