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

Side by Side Diff: chrome/browser/notifications/notification_test_util.h

Issue 2860473002: [Merge to M58] CrOS: Do not allow notifications to be added during shutdown. (Closed)
Patch Set: Created 3 years, 7 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 ProfileID profile_id) const override; 63 ProfileID profile_id) const override;
64 bool CancelById(const std::string& delegate_id, 64 bool CancelById(const std::string& delegate_id,
65 ProfileID profile_id) override; 65 ProfileID profile_id) override;
66 std::set<std::string> GetAllIdsByProfileAndSourceOrigin( 66 std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
67 ProfileID profile_id, 67 ProfileID profile_id,
68 const GURL& source) override; 68 const GURL& source) override;
69 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override; 69 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override;
70 bool CancelAllBySourceOrigin(const GURL& source_origin) override; 70 bool CancelAllBySourceOrigin(const GURL& source_origin) override;
71 bool CancelAllByProfile(ProfileID profile_id) override; 71 bool CancelAllByProfile(ProfileID profile_id) override;
72 void CancelAll() override; 72 void CancelAll() override;
73 void StartShutdown() override;
73 74
74 private: 75 private:
75 using NotificationPair = std::pair<Notification, ProfileID>; 76 using NotificationPair = std::pair<Notification, ProfileID>;
76 std::vector<NotificationPair> notifications_; 77 std::vector<NotificationPair> notifications_;
77 78
78 base::Closure notification_added_callback_; 79 base::Closure notification_added_callback_;
79 80
81 bool is_shutdown_started_ = false;
82
80 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager); 83 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager);
81 }; 84 };
82 85
83 // Helper class that has to be created in the stack to check if the fullscreen 86 // Helper class that has to be created in the stack to check if the fullscreen
84 // setting of a browser is in the desired state. 87 // setting of a browser is in the desired state.
85 class FullscreenStateWaiter { 88 class FullscreenStateWaiter {
86 public: 89 public:
87 FullscreenStateWaiter(Browser* browser, bool desired_state); 90 FullscreenStateWaiter(Browser* browser, bool desired_state);
88 91
89 void Wait(); 92 void Wait();
90 93
91 private: 94 private:
92 Browser* browser_; 95 Browser* browser_;
93 bool desired_state_; 96 bool desired_state_;
94 97
95 DISALLOW_COPY_AND_ASSIGN(FullscreenStateWaiter); 98 DISALLOW_COPY_AND_ASSIGN(FullscreenStateWaiter);
96 }; 99 };
97 100
98 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ 101 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_system_observer.cc ('k') | chrome/browser/notifications/notification_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698