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

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

Issue 7489019: Fix up various browser tests not to use WaitForNavigation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Use the single WNO ctor. Created 9 years, 4 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 #include "chrome/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 #if defined(TOOLKIT_VIEWS) 51 #if defined(TOOLKIT_VIEWS)
52 #include "views/focus/accelerator_handler.h" 52 #include "views/focus/accelerator_handler.h"
53 #endif 53 #endif
54 54
55 namespace ui_test_utils { 55 namespace ui_test_utils {
56 56
57 namespace { 57 namespace {
58 58
59 // Used to block until a navigation completes. 59 // Used to block until a navigation completes.
60 // TODO(gbillock): this should be merged with TestNavigationObserver
Paweł Hajdan Jr. 2011/08/04 17:56:48 Thanks, and IMHO this is a very high priority. If
Greg Billock 2011/08/11 22:57:45 Sounds good. I'm planning on a sequence of these a
Greg Billock 2011/08/11 22:57:45 Yeah, I plan on a series of changes, and this is n
Paweł Hajdan Jr. 2011/08/11 23:03:02 You can try --gtest_repeat=-1 --gtest_break_on_fai
60 class NavigationNotificationObserver : public NotificationObserver { 61 class NavigationNotificationObserver : public NotificationObserver {
61 public: 62 public:
62 NavigationNotificationObserver(const NotificationSource& source, 63 NavigationNotificationObserver(const NotificationSource& source,
63 int number_of_navigations) 64 int number_of_navigations)
64 : navigation_started_(false), 65 : navigation_started_(false),
65 navigations_completed_(0), 66 navigations_completed_(0),
66 number_of_navigations_(number_of_navigations), 67 number_of_navigations_(number_of_navigations),
67 running_(false), 68 running_(false),
68 done_(false) { 69 done_(false) {
69 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); 70 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source);
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); 1044 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap);
1044 } 1045 }
1045 1046
1046 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { 1047 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) {
1047 DCHECK(bitmap); 1048 DCHECK(bitmap);
1048 SnapshotTaker taker; 1049 SnapshotTaker taker;
1049 return taker.TakeEntirePageSnapshot(rvh, bitmap); 1050 return taker.TakeEntirePageSnapshot(rvh, bitmap);
1050 } 1051 }
1051 1052
1052 } // namespace ui_test_utils 1053 } // namespace ui_test_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698