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

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: Now testing without the private API 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 92b897a48458268f711af6ac49c900a005dcb17d..3800c6c888b3dd3e5c15cd51f2c42bbe625c72f8 100644
--- a/ui/base/test/windowed_nsnotification_observer.h
+++ b/ui/base/test/windowed_nsnotification_observer.h
@@ -15,26 +15,31 @@ 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;
+- (id)initForNotification:(NSString*)name object:(id)notificationSender;
// 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.
jackhou1 2015/06/22 01:34:26 This quits the run loop as soon as a notification
tapted 2015/06/22 01:57:08 ooh! good catch. That wasn't intentional - I think
+// 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