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

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: Add a ScopedOleInitializer for Windows Created 7 years, 8 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 | « content/public/test/mock_render_process_host.cc ('k') | content/public/test/test_notification_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..13cebd64a967aa22f4313d6b2821afcf1aa6a4e0 100644
--- a/content/public/test/test_notification_tracker.h
+++ b/content/public/test/test_notification_tracker.h
@@ -45,6 +45,9 @@ class TestNotificationTracker : public NotificationObserver {
// Clears the list of events.
void Reset();
+ // TODO(jyasskin): Replace calls to Check*AndReset() with
+ // EXPECT_THAT(GetTypesAndReset()).
+ //
// Given notifications type(sp, returns true if the list of notifications
// were exactly those listed in the given arg(s), and in the same order.
//
@@ -61,6 +64,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(); }
« no previous file with comments | « content/public/test/mock_render_process_host.cc ('k') | content/public/test/test_notification_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698