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

Side by Side Diff: chrome/test/base/ui_test_utils.h

Issue 653773004: Standardize usage of virtual/override/final in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « chrome/test/base/tracing.cc ('k') | chrome/test/base/view_event_test_platform_part_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_TEST_BASE_UI_TEST_UTILS_H_ 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_
6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 public: 170 public:
171 // Register to listen for notifications of NOTIFICATION_TAB_ADDED from either 171 // Register to listen for notifications of NOTIFICATION_TAB_ADDED from either
172 // a specific source, or from all sources if |source| is 172 // a specific source, or from all sources if |source| is
173 // NotificationService::AllSources(). 173 // NotificationService::AllSources().
174 explicit WindowedTabAddedNotificationObserver( 174 explicit WindowedTabAddedNotificationObserver(
175 const content::NotificationSource& source); 175 const content::NotificationSource& source);
176 176
177 // Returns the added tab, or NULL if no notification was observed yet. 177 // Returns the added tab, or NULL if no notification was observed yet.
178 content::WebContents* GetTab() { return added_tab_; } 178 content::WebContents* GetTab() { return added_tab_; }
179 179
180 virtual void Observe(int type, 180 void Observe(int type,
181 const content::NotificationSource& source, 181 const content::NotificationSource& source,
182 const content::NotificationDetails& details) override; 182 const content::NotificationDetails& details) override;
183 183
184 private: 184 private:
185 content::WebContents* added_tab_; 185 content::WebContents* added_tab_;
186 186
187 DISALLOW_COPY_AND_ASSIGN(WindowedTabAddedNotificationObserver); 187 DISALLOW_COPY_AND_ASSIGN(WindowedTabAddedNotificationObserver);
188 }; 188 };
189 189
190 // Similar to WindowedNotificationObserver but also provides a way of retrieving 190 // Similar to WindowedNotificationObserver but also provides a way of retrieving
191 // the details associated with the notification. 191 // the details associated with the notification.
192 // Note that in order to use that class the details class should be copiable, 192 // Note that in order to use that class the details class should be copiable,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 }; 226 };
227 227
228 // Notification observer which waits for navigation events and blocks until 228 // Notification observer which waits for navigation events and blocks until
229 // a specific URL is loaded. The URL must be an exact match. 229 // a specific URL is loaded. The URL must be an exact match.
230 class UrlLoadObserver : public content::WindowedNotificationObserver { 230 class UrlLoadObserver : public content::WindowedNotificationObserver {
231 public: 231 public:
232 // Register to listen for notifications of the given type from either a 232 // Register to listen for notifications of the given type from either a
233 // specific source, or from all sources if |source| is 233 // specific source, or from all sources if |source| is
234 // NotificationService::AllSources(). 234 // NotificationService::AllSources().
235 UrlLoadObserver(const GURL& url, const content::NotificationSource& source); 235 UrlLoadObserver(const GURL& url, const content::NotificationSource& source);
236 virtual ~UrlLoadObserver(); 236 ~UrlLoadObserver() override;
237 237
238 // content::NotificationObserver: 238 // content::NotificationObserver:
239 virtual void Observe(int type, 239 void Observe(int type,
240 const content::NotificationSource& source, 240 const content::NotificationSource& source,
241 const content::NotificationDetails& details) override; 241 const content::NotificationDetails& details) override;
242 242
243 private: 243 private:
244 GURL url_; 244 GURL url_;
245 245
246 DISALLOW_COPY_AND_ASSIGN(UrlLoadObserver); 246 DISALLOW_COPY_AND_ASSIGN(UrlLoadObserver);
247 }; 247 };
248 248
249 // Convenience class for waiting for a new browser to be created. 249 // Convenience class for waiting for a new browser to be created.
250 // Like WindowedNotificationObserver, this class provides a safe, non-racey 250 // Like WindowedNotificationObserver, this class provides a safe, non-racey
251 // way to wait for a new browser to be created. 251 // way to wait for a new browser to be created.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 std::vector<GURL> urls_; 290 std::vector<GURL> urls_;
291 291
292 base::CancelableTaskTracker tracker_; 292 base::CancelableTaskTracker tracker_;
293 293
294 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); 294 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator);
295 }; 295 };
296 296
297 } // namespace ui_test_utils 297 } // namespace ui_test_utils
298 298
299 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ 299 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/test/base/tracing.cc ('k') | chrome/test/base/view_event_test_platform_part_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698