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 #include "chrome/browser/notifications/notification_test_util.h" | 5 #include "chrome/browser/notifications/notification_test_util.h" |
6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| 9 #include "content/public/test/test_utils.h" |
| 10 |
7 MockNotificationDelegate::MockNotificationDelegate(const std::string& id) | 11 MockNotificationDelegate::MockNotificationDelegate(const std::string& id) |
8 : id_(id) {} | 12 : id_(id) {} |
9 | 13 |
10 MockNotificationDelegate::~MockNotificationDelegate() {} | 14 MockNotificationDelegate::~MockNotificationDelegate() {} |
11 | 15 |
12 std::string MockNotificationDelegate::id() const { return id_; } | 16 std::string MockNotificationDelegate::id() const { return id_; } |
13 | 17 |
14 // ----------------------------------------------------------------------------- | 18 // ----------------------------------------------------------------------------- |
15 | 19 |
16 StubNotificationUIManager::StubNotificationUIManager() {} | 20 StubNotificationUIManager::StubNotificationUIManager() {} |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 bool StubNotificationUIManager::CancelAllByProfile(ProfileID profile_id) { | 132 bool StubNotificationUIManager::CancelAllByProfile(ProfileID profile_id) { |
129 NOTIMPLEMENTED(); | 133 NOTIMPLEMENTED(); |
130 return false; | 134 return false; |
131 } | 135 } |
132 | 136 |
133 void StubNotificationUIManager::CancelAll() { | 137 void StubNotificationUIManager::CancelAll() { |
134 for (const auto& pair : notifications_) | 138 for (const auto& pair : notifications_) |
135 pair.first.delegate()->Close(false /* by_user */); | 139 pair.first.delegate()->Close(false /* by_user */); |
136 notifications_.clear(); | 140 notifications_.clear(); |
137 } | 141 } |
| 142 |
| 143 FullscreenStateWaiter::FullscreenStateWaiter( |
| 144 Browser* browser, bool desired_state) |
| 145 : browser_(browser), |
| 146 desired_state_(desired_state) {} |
| 147 |
| 148 void FullscreenStateWaiter::Wait() { |
| 149 while (desired_state_ != |
| 150 browser_->exclusive_access_manager()->context()->IsFullscreen()) { |
| 151 content::RunAllPendingInMessageLoop(); |
| 152 } |
| 153 } |
OLD | NEW |