OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 DISALLOW_COPY_AND_ASSIGN(WindowedNotificationObserverWithDetails); | 471 DISALLOW_COPY_AND_ASSIGN(WindowedNotificationObserverWithDetails); |
472 }; | 472 }; |
473 | 473 |
474 // Watches title changes on a tab, blocking until an expected title is set. | 474 // Watches title changes on a tab, blocking until an expected title is set. |
475 class TitleWatcher : public NotificationObserver { | 475 class TitleWatcher : public NotificationObserver { |
476 public: | 476 public: |
477 // |tab_contents| must be non-NULL and needs to stay alive for the | 477 // |tab_contents| must be non-NULL and needs to stay alive for the |
478 // entire lifetime of |this|. |expected_title| is the title that |this| | 478 // entire lifetime of |this|. |expected_title| is the title that |this| |
479 // will wait for. | 479 // will wait for. |
480 TitleWatcher(TabContents* tab_contents, const string16& expected_title); | 480 TitleWatcher(TabContents* tab_contents, const string16& expected_title); |
481 ~TitleWatcher(); | 481 virtual ~TitleWatcher(); |
482 | 482 |
483 // Waits until the title for the tab is set to the |expected_title| | 483 // Waits until the title for the tab is set to the |expected_title| |
484 // passed into the constructor. | 484 // passed into the constructor. |
485 bool Wait() WARN_UNUSED_RESULT; | 485 bool Wait() WARN_UNUSED_RESULT; |
486 | 486 |
487 private: | 487 private: |
488 // NotificationObserver | 488 // NotificationObserver |
489 virtual void Observe(NotificationType type, | 489 virtual void Observe(NotificationType type, |
490 const NotificationSource& source, | 490 const NotificationSource& source, |
491 const NotificationDetails& details) OVERRIDE; | 491 const NotificationDetails& details) OVERRIDE; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 | 579 |
580 // Takes a snapshot of the entire page, according to the width and height | 580 // Takes a snapshot of the entire page, according to the width and height |
581 // properties of the DOM's document. Returns true on success. DOMAutomation | 581 // properties of the DOM's document. Returns true on success. DOMAutomation |
582 // must be enabled. | 582 // must be enabled. |
583 bool TakeEntirePageSnapshot(RenderViewHost* rvh, | 583 bool TakeEntirePageSnapshot(RenderViewHost* rvh, |
584 SkBitmap* bitmap) WARN_UNUSED_RESULT; | 584 SkBitmap* bitmap) WARN_UNUSED_RESULT; |
585 | 585 |
586 } // namespace ui_test_utils | 586 } // namespace ui_test_utils |
587 | 587 |
588 #endif // CHROME_TEST_UI_TEST_UTILS_H_ | 588 #endif // CHROME_TEST_UI_TEST_UTILS_H_ |
OLD | NEW |