Index: chrome/browser/notifications/notification_test_util.cc |
diff --git a/chrome/browser/notifications/notification_test_util.cc b/chrome/browser/notifications/notification_test_util.cc |
index 41cf5217a7bf368cd1f88332f5d62c1b9684bf31..a04690e696d383b5582c57ae1ce24ec83d585663 100644 |
--- a/chrome/browser/notifications/notification_test_util.cc |
+++ b/chrome/browser/notifications/notification_test_util.cc |
@@ -4,6 +4,10 @@ |
#include "chrome/browser/notifications/notification_test_util.h" |
+#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
+#include "content/public/test/test_utils.h" |
+ |
MockNotificationDelegate::MockNotificationDelegate(const std::string& id) |
: id_(id) {} |
@@ -135,3 +139,15 @@ void StubNotificationUIManager::CancelAll() { |
pair.first.delegate()->Close(false /* by_user */); |
notifications_.clear(); |
} |
+ |
+FullscreenStateWaiter::FullscreenStateWaiter( |
+ Browser* browser, bool desired_state) |
+ : browser_(browser), |
+ desired_state_(desired_state) {} |
+ |
+void FullscreenStateWaiter::Wait() { |
+ while (desired_state_ != |
+ browser_->exclusive_access_manager()->context()->IsFullscreen()) { |
+ content::RunAllPendingInMessageLoop(); |
+ } |
+} |