| 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 #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 Loading... |
| 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 | |
| 61 class NavigationNotificationObserver : public NotificationObserver { | 60 class NavigationNotificationObserver : public NotificationObserver { |
| 62 public: | 61 public: |
| 63 NavigationNotificationObserver(const NotificationSource& source, | 62 NavigationNotificationObserver(const NotificationSource& source, |
| 64 int number_of_navigations) | 63 int number_of_navigations) |
| 65 : navigation_started_(false), | 64 : navigation_started_(false), |
| 66 navigations_completed_(0), | 65 navigations_completed_(0), |
| 67 number_of_navigations_(number_of_navigations), | 66 number_of_navigations_(number_of_navigations), |
| 68 running_(false), | 67 running_(false), |
| 69 done_(false) { | 68 done_(false) { |
| 70 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); | 69 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 1051 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
| 1053 } | 1052 } |
| 1054 | 1053 |
| 1055 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 1054 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
| 1056 DCHECK(bitmap); | 1055 DCHECK(bitmap); |
| 1057 SnapshotTaker taker; | 1056 SnapshotTaker taker; |
| 1058 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1057 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
| 1059 } | 1058 } |
| 1060 | 1059 |
| 1061 } // namespace ui_test_utils | 1060 } // namespace ui_test_utils |
| OLD | NEW |