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

Side by Side Diff: content/public/test/repeated_notification_observer.h

Issue 2798143004: Fix for URL opening code (Closed)
Patch Set: Fixed class name usage. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_TEST_REPEATED_NOTIFICATION_OBSERVER_H_
6 #define CONTENT_PUBLIC_TEST_REPEATED_NOTIFICATION_OBSERVER_H_
7
8 #include "base/run_loop.h"
9 #include "content/public/browser/notification_observer.h"
10 #include "content/public/browser/notification_registrar.h"
11
12 namespace content {
13
14 // RepeatedNotificationObserver allows code to wait until specified number
15 // of notifications of particular type are posted.
16 class RepeatedNotificationObserver : public NotificationObserver {
17 public:
18 RepeatedNotificationObserver(int type, int count);
19
20 // NotificationObserver:
21 void Observe(int type,
22 const NotificationSource& source,
23 const NotificationDetails& details) override;
24
25 // Wait until |count| events of |type| (both specified in constructor) happen.
26 void Wait();
27
28 private:
29 int num_outstanding_;
30 NotificationRegistrar registrar_;
31 bool running_;
32 base::RunLoop run_loop_;
33
34 DISALLOW_COPY_AND_ASSIGN(RepeatedNotificationObserver);
35 };
36
37 } // namespace content
38
39 #endif // CONTENT_PUBLIC_TEST_REPEATED_NOTIFICATION_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore_browsertest.cc ('k') | content/public/test/repeated_notification_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698