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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6cea213740222f46bd10a5ac21fe52ead0535d5f |
--- /dev/null |
+++ b/ui/base/test/windowed_nsnotification_observer.h |
@@ -0,0 +1,32 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_GFX_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_ |
+#define UI_GFX_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_ |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+#import "base/mac/scoped_nsobject.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/run_loop.h" |
+ |
+// Watches for NSNotifications. |
+@interface WindowedNSNotificationObserver : NSObject { |
+ @private |
+ base::scoped_nsobject<NSString> bundleId_; |
+ BOOL notificationReceived_; |
+ scoped_ptr<base::RunLoop> runLoop_; |
+} |
+ |
+// Watch for a notification on the default notification center. |
+- (id)initForNotification:(NSString*)name; |
+// Watch for a notification on the shared workspace notification center for the |
+// given application. |
+- (id)initForNotification:(NSString*)name |
+ andBundleId:(NSString*)bundleId; |
+- (void)wait; |
+@end |
+ |
+#endif // UI_GFX_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_ |
+ |