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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
548 bool TakeRenderWidgetSnapshot(RenderWidgetHost* rwh, | 548 bool TakeRenderWidgetSnapshot(RenderWidgetHost* rwh, |
549 const gfx::Size& page_size, | 549 const gfx::Size& page_size, |
550 SkBitmap* bitmap) WARN_UNUSED_RESULT; | 550 SkBitmap* bitmap) WARN_UNUSED_RESULT; |
551 | 551 |
552 // Takes a snapshot of the entire page, according to the width and height | 552 // Takes a snapshot of the entire page, according to the width and height |
553 // properties of the DOM's document. Returns true on success. DOMAutomation | 553 // properties of the DOM's document. Returns true on success. DOMAutomation |
554 // must be enabled. | 554 // must be enabled. |
555 bool TakeEntirePageSnapshot(RenderViewHost* rvh, | 555 bool TakeEntirePageSnapshot(RenderViewHost* rvh, |
556 SkBitmap* bitmap) WARN_UNUSED_RESULT; | 556 SkBitmap* bitmap) WARN_UNUSED_RESULT; |
557 | 557 |
558 // Watches title changes on a tab, blocking until an expected title is set. | |
559 class TitleWatcher : public NotificationObserver { | |
560 public: | |
561 // |tab_contents| must be non-NULL and needs to stay alive for the | |
562 // entire lifetime of |this|. |expected_title| is the title that |this| | |
563 // will wait for. | |
564 TitleWatcher(TabContents* tab_contents, const string16& expected_title); | |
565 ~TitleWatcher(); | |
566 | |
567 // Waits until the title for the tab is set to the |expected_title| | |
568 // passed into the constructor. | |
569 bool WaitForTitleChange() WARN_UNUSED_RESULT; | |
Paweł Hajdan Jr.
2011/06/09 20:08:27
And now, please make it consistent with WindowedNo
cbentzel
2011/06/10 00:41:31
Done.
| |
570 | |
571 private: | |
572 // NotificationObserver | |
573 virtual void Observe(NotificationType type, | |
574 const NotificationSource& source, | |
575 const NotificationDetails& details) OVERRIDE; | |
576 | |
577 TabContents* expected_tab_; | |
578 string16 expected_title_; | |
579 NotificationRegistrar notification_registrar_; | |
580 bool title_observed_; | |
581 bool quit_loop_on_observation_; | |
582 | |
583 DISALLOW_COPY_AND_ASSIGN(TitleWatcher); | |
584 }; | |
585 | |
558 } // namespace ui_test_utils | 586 } // namespace ui_test_utils |
559 | 587 |
560 #endif // CHROME_TEST_UI_TEST_UTILS_H_ | 588 #endif // CHROME_TEST_UI_TEST_UTILS_H_ |
OLD | NEW |