Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "chrome/browser/notifications/notification.h" | 15 #include "chrome/browser/notifications/notification.h" |
| 16 #include "chrome/browser/notifications/notification_ui_manager.h" | 16 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 17 | 17 |
| 18 class Browser; | |
| 18 class Profile; | 19 class Profile; |
| 19 | 20 |
| 20 // NotificationDelegate which does nothing, useful for testing when | 21 // NotificationDelegate which does nothing, useful for testing when |
| 21 // the notification events are not important. | 22 // the notification events are not important. |
| 22 class MockNotificationDelegate : public NotificationDelegate { | 23 class MockNotificationDelegate : public NotificationDelegate { |
| 23 public: | 24 public: |
| 24 explicit MockNotificationDelegate(const std::string& id); | 25 explicit MockNotificationDelegate(const std::string& id); |
| 25 | 26 |
| 26 // NotificationDelegate interface. | 27 // NotificationDelegate interface. |
| 27 std::string id() const override; | 28 std::string id() const override; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 using NotificationPair = std::pair<Notification, ProfileID>; | 69 using NotificationPair = std::pair<Notification, ProfileID>; |
| 69 std::vector<NotificationPair> notifications_; | 70 std::vector<NotificationPair> notifications_; |
| 70 | 71 |
| 71 base::Closure notification_added_callback_; | 72 base::Closure notification_added_callback_; |
| 72 | 73 |
| 73 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager); | 74 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager); |
| 74 }; | 75 }; |
| 75 | 76 |
| 77 // Helper class that has to be created in the stack to check if the fullscreen | |
| 78 // setting of a browser is in the desired state. | |
| 79 class FullscreenStateWaiter { | |
| 80 public: | |
| 81 explicit FullscreenStateWaiter(Browser* browser, bool desired_state); | |
|
Peter Beverloo
2016/09/29 21:30:52
nit: no need to make this explicit (we only do tha
bmalcolm
2016/09/29 21:37:13
Done.
| |
| 82 | |
| 83 void Wait(); | |
| 84 | |
| 85 private: | |
| 86 Browser* browser_; | |
| 87 bool desired_state_; | |
| 88 | |
| 89 DISALLOW_COPY_AND_ASSIGN(FullscreenStateWaiter); | |
| 90 }; | |
| 91 | |
|
Peter Beverloo
2016/09/29 21:30:52
micro nit: no double blank lines
bmalcolm
2016/09/29 21:37:13
Done.
| |
| 92 | |
| 76 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 93 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
| OLD | NEW |