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

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: Fix handing of guest user ID. 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/public/test/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/public/test/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698