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

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

Issue 1186803003: Mac: Give packaged app windows their own window cycle list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase (overlap with r335812 and I want a fresh CQ run) Created 5 years, 6 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 | « tools/metrics/histograms/histograms.xml ('k') | ui/base/test/windowed_nsnotification_observer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/windowed_nsnotification_observer.h
diff --git a/ui/base/test/windowed_nsnotification_observer.h b/ui/base/test/windowed_nsnotification_observer.h
index ffecd97444c766ef55152b72710a2e52d4a9b75d..9a3cb24b9aef046d729fe9d6f3ad396f0bc70041 100644
--- a/ui/base/test/windowed_nsnotification_observer.h
+++ b/ui/base/test/windowed_nsnotification_observer.h
@@ -15,16 +15,17 @@ class RunLoop;
// Like WindowedNotificationObserver in content/public/test/test_utils.h, this
// starts watching for a notification upon construction and can wait until the
-// notification is observed. This guarantees that a notification fired between
+// notification is observed. This guarantees that notifications fired between
// calls to init and wait will be caught.
@interface WindowedNSNotificationObserver : NSObject {
@private
base::scoped_nsobject<NSString> bundleId_;
- BOOL notificationReceived_;
+ int notificationCount_;
base::RunLoop* runLoop_;
}
-// Watch for an NSNotification on the default notification center.
+// Watch for an NSNotification on the default notification center for the given
+// |notificationSender|, or a nil object if omitted.
- (id)initForNotification:(NSString*)name;
// Watch for an NSNotification on the default notification center from a
@@ -32,13 +33,16 @@ class RunLoop;
- (id)initForNotification:(NSString*)name object:(id)sender;
// Watch for an NSNotification on the shared workspace notification center for
-// the
-// given application.
+// the given application.
- (id)initForWorkspaceNotification:(NSString*)name bundleId:(NSString*)bundleId;
-// Returns if the notification has been observed, or spins a RunLoop until it
-// is. Stops observing.
-- (void)wait;
+// Waits for |minimumCount| notifications to be observed and returns YES.
+// Returns NO on a timeout. This can be called multiple times.
+- (BOOL)waitForCount:(int)minimumCount;
+
+// Returns YES if any notification has been observed, or spins a RunLoop until
+// it either is observed, or a timeout occurs. Returns NO on a timeout.
+- (BOOL)wait;
@end
#endif // UI_BASE_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/base/test/windowed_nsnotification_observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698