| Index: content/public/test/test_utils.h
|
| diff --git a/content/public/test/test_utils.h b/content/public/test/test_utils.h
|
| index 0b8fa7620996f9a4658aaa7c6a48dae9dd57585e..c1aa189888a2bc631c735eee3ed3ad14528fcd40 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();
|
|
|
|
|