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

Unified Diff: content/public/test/test_utils.h

Issue 24261010: Allow explicitly whitelisted apps/extensions in public sessions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: constness fix. Created 7 years, 2 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
Index: content/public/test/test_utils.h
diff --git a/content/public/test/test_utils.h b/content/public/test/test_utils.h
index 3b824cc126b39ce7b199cc5cec5a841100baa292..ce9282ef933f442f9dccd4a6ab8ec69bf255089a 100644
--- a/content/public/test/test_utils.h
+++ b/content/public/test/test_utils.h
@@ -100,7 +100,8 @@ class MessageLoopRunner : public base::RefCounted<MessageLoopRunner> {
// If the callback returns |true|, the condition is met. Otherwise, the
// condition is not yet met and the callback will be invoked again every time a
// notification of the expected type is received until the callback returns
-// |true|.
+// |true|. For convenience, two callback types are defined, one that is provided
+// with the notification source and details, and one that is not.
//
// This helper class exists to avoid the following common pattern in tests:
// PerformAction()
@@ -116,8 +117,14 @@ class MessageLoopRunner : public base::RefCounted<MessageLoopRunner> {
class WindowedNotificationObserver : public NotificationObserver {
public:
// Callback invoked on notifications. Should return |true| when the condition
- // being waited for is met.
- typedef base::Callback<bool(void)> ConditionTestCallback;
+ // being waited for is met. For convenience, there is a choice between two
+ // callback types, one that is provided with the notification source and
+ // details, and one that is not.
+ typedef base::Callback<bool(const NotificationSource&,
+ const NotificationDetails&)>
+ ConditionTestCallback;
+ typedef base::Callback<bool(void)>
+ ConditionTestCallbackWithoutSourceAndDetails;
// Set up to wait for a simple condition. The condition is met when a
// notification of the given |notification_type| from the given |source| is
@@ -131,6 +138,9 @@ class WindowedNotificationObserver : public NotificationObserver {
// of |notification_type| from any source is received.
WindowedNotificationObserver(int notification_type,
const ConditionTestCallback& callback);
+ WindowedNotificationObserver(
+ int notification_type,
+ const ConditionTestCallbackWithoutSourceAndDetails& callback);
virtual ~WindowedNotificationObserver();

Powered by Google App Engine
This is Rietveld 408576698