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 | |
11 | |
Peter Beverloo
2016/09/29 21:30:51
micro nit: no double blank lines
bmalcolm
2016/09/29 21:37:13
Done.
| |
7 MockNotificationDelegate::MockNotificationDelegate(const std::string& id) | 12 MockNotificationDelegate::MockNotificationDelegate(const std::string& id) |
8 : id_(id) {} | 13 : id_(id) {} |
9 | 14 |
10 MockNotificationDelegate::~MockNotificationDelegate() {} | 15 MockNotificationDelegate::~MockNotificationDelegate() {} |
11 | 16 |
12 std::string MockNotificationDelegate::id() const { return id_; } | 17 std::string MockNotificationDelegate::id() const { return id_; } |
13 | 18 |
14 // ----------------------------------------------------------------------------- | 19 // ----------------------------------------------------------------------------- |
15 | 20 |
16 StubNotificationUIManager::StubNotificationUIManager() {} | 21 StubNotificationUIManager::StubNotificationUIManager() {} |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 bool StubNotificationUIManager::CancelAllByProfile(ProfileID profile_id) { | 133 bool StubNotificationUIManager::CancelAllByProfile(ProfileID profile_id) { |
129 NOTIMPLEMENTED(); | 134 NOTIMPLEMENTED(); |
130 return false; | 135 return false; |
131 } | 136 } |
132 | 137 |
133 void StubNotificationUIManager::CancelAll() { | 138 void StubNotificationUIManager::CancelAll() { |
134 for (const auto& pair : notifications_) | 139 for (const auto& pair : notifications_) |
135 pair.first.delegate()->Close(false /* by_user */); | 140 pair.first.delegate()->Close(false /* by_user */); |
136 notifications_.clear(); | 141 notifications_.clear(); |
137 } | 142 } |
143 | |
144 FullscreenStateWaiter::FullscreenStateWaiter( | |
145 Browser* browser, bool desired_state) | |
146 : browser_(browser), | |
147 desired_state_(desired_state) {} | |
148 | |
149 void FullscreenStateWaiter::Wait() { | |
150 while (desired_state_ != | |
151 browser_->exclusive_access_manager()->context()->IsFullscreen()) | |
152 content::RunAllPendingInMessageLoop(); | |
Peter Beverloo
2016/09/29 21:30:51
nit: curly brackets for multi-line statements
bmalcolm
2016/09/29 21:37:13
Done.
| |
153 } | |
OLD | NEW |