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

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

Issue 13533007: Test extension reloading behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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_notification_tracker.h
diff --git a/content/public/test/test_notification_tracker.h b/content/public/test/test_notification_tracker.h
index f34fdae614da5b8acd16eea4985cab6c5b41bda9..14735c898cd31c1ce350c52c6211e55e1790fa51 100644
--- a/content/public/test/test_notification_tracker.h
+++ b/content/public/test/test_notification_tracker.h
@@ -61,6 +61,20 @@ class TestNotificationTracker : public NotificationObserver {
int type2,
int type3);
+ // Returns the types of the received notifications in order. Usable
+ // with EXPECT_THAT(ElementsAre):
+ // EXPECT_THAT(tracker.GetTypesAndReset(),
+ // testing::ElementsAre(content::NOTIFICATION_LOAD_START, ...));
+ std::vector<int> GetTypes() const;
+
+ // Like GetTypes, but also calls Reset() so that the next call will
+ // only check for new notifications.
+ std::vector<int> GetTypesAndReset() {
+ std::vector<int> result = GetTypes();
+ Reset();
+ return result;
+ }
+
// Returns the number of notifications received since the last reset.
size_t size() const { return events_.size(); }

Powered by Google App Engine
This is Rietveld 408576698