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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 private: | 441 private: |
442 bool seen_; | 442 bool seen_; |
443 bool running_; | 443 bool running_; |
444 std::set<uintptr_t> sources_seen_; | 444 std::set<uintptr_t> sources_seen_; |
445 content::NotificationSource waiting_for_; | 445 content::NotificationSource waiting_for_; |
446 content::NotificationRegistrar registrar_; | 446 content::NotificationRegistrar registrar_; |
447 | 447 |
448 DISALLOW_COPY_AND_ASSIGN(WindowedNotificationObserver); | 448 DISALLOW_COPY_AND_ASSIGN(WindowedNotificationObserver); |
449 }; | 449 }; |
450 | 450 |
| 451 // A WindowedNotificationObserver hard-wired to observe |
| 452 // chrome::NOTIFICATION_TAB_ADDED. |
| 453 class WindowedTabAddedNotificationObserver |
| 454 : public WindowedNotificationObserver { |
| 455 public: |
| 456 // Register to listen for notifications of NOTIFICATION_TAB_ADDED from either |
| 457 // a specific source, or from all sources if |source| is |
| 458 // NotificationService::AllSources(). |
| 459 WindowedTabAddedNotificationObserver( |
| 460 const content::NotificationSource& source); |
| 461 |
| 462 private: |
| 463 DISALLOW_COPY_AND_ASSIGN(WindowedTabAddedNotificationObserver); |
| 464 }; |
| 465 |
451 // Similar to WindowedNotificationObserver but also provides a way of retrieving | 466 // Similar to WindowedNotificationObserver but also provides a way of retrieving |
452 // the details associated with the notification. | 467 // the details associated with the notification. |
453 // Note that in order to use that class the details class should be copiable, | 468 // Note that in order to use that class the details class should be copiable, |
454 // which is the case with most notifications. | 469 // which is the case with most notifications. |
455 template <class U> | 470 template <class U> |
456 class WindowedNotificationObserverWithDetails | 471 class WindowedNotificationObserverWithDetails |
457 : public WindowedNotificationObserver { | 472 : public WindowedNotificationObserver { |
458 public: | 473 public: |
459 WindowedNotificationObserverWithDetails( | 474 WindowedNotificationObserverWithDetails( |
460 int notification_type, | 475 int notification_type, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 // ui_controls_linux.cc and ui_controls_mac.cc | 663 // ui_controls_linux.cc and ui_controls_mac.cc |
649 void ClickTask(ui_controls::MouseButton button, | 664 void ClickTask(ui_controls::MouseButton button, |
650 int state, | 665 int state, |
651 const base::Closure& followup); | 666 const base::Closure& followup); |
652 | 667 |
653 } // namespace internal | 668 } // namespace internal |
654 | 669 |
655 } // namespace ui_test_utils | 670 } // namespace ui_test_utils |
656 | 671 |
657 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 672 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |