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

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

Issue 7046053: Add PrerenderUnload browser test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move TitleWatcher to ui_test_utils Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698