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

Unified Diff: chrome/test/base/ui_test_utils.h

Issue 11414223: Move the test functions that deal with focus to interactive_ui_tets_utils.h and into the interactiv… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/ui_test_utils.h
===================================================================
--- chrome/test/base/ui_test_utils.h (revision 170118)
+++ chrome/test/base/ui_test_utils.h (working copy)
@@ -15,7 +15,6 @@
#include "base/memory/ref_counted.h"
#include "base/string16.h"
#include "chrome/browser/history/history.h"
-#include "chrome/browser/ui/view_ids.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -25,13 +24,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/native_widget_types.h"
-#include "ui/ui_controls/ui_controls.h"
#include "webkit/glue/window_open_disposition.h"
-#if defined(TOOLKIT_VIEWS)
-#include "ui/views/view.h"
-#endif
-
class AppModalDialog;
class BookmarkModel;
class Browser;
@@ -53,7 +47,6 @@
}
namespace gfx {
-class Point;
class Rect;
class Size;
}
@@ -144,12 +137,6 @@
int* ordinal,
gfx::Rect* selection_rect);
-// Returns true if the View is focused.
-bool IsViewFocused(const Browser* browser, ViewID vid);
-
-// Simulates a mouse click on a View in the browser.
-void ClickOnView(const Browser* browser, ViewID vid);
-
// Register |observer| for the given |type| and |source| and run
// the message loop until the observer posts a quit task.
void RegisterAndWait(content::NotificationObserver* observer,
@@ -172,44 +159,9 @@
void SendToOmniboxAndSubmit(LocationBar* location_bar,
const std::string& input);
-// Brings the native window for |browser| to the foreground. Returns true on
-// success.
-bool BringBrowserWindowToFront(const Browser* browser) WARN_UNUSED_RESULT;
-
// Gets the first browser that is not in the specified set.
Browser* GetBrowserNotInSet(std::set<Browser*> excluded_browsers);
-// Sends a key press, blocking until the key press is received or the test times
-// out. This uses ui_controls::SendKeyPress, see it for details. Returns true
-// if the event was successfully sent and received.
-bool SendKeyPressSync(const Browser* browser,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command) WARN_UNUSED_RESULT;
-
-// Sends a key press, blocking until both the key press and a notification from
-// |source| of type |type| are received, or until the test times out. This uses
-// ui_controls::SendKeyPress, see it for details. Returns true if the event was
-// successfully sent and both the event and notification were received.
-bool SendKeyPressAndWait(const Browser* browser,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command,
- int type,
- const content::NotificationSource& source)
- WARN_UNUSED_RESULT;
-
-// Sends a move event blocking until received. Returns true if the event was
-// successfully received. This uses ui_controls::SendMouse***NotifyWhenDone,
-// see it for details.
-bool SendMouseMoveSync(const gfx::Point& location) WARN_UNUSED_RESULT;
-bool SendMouseEventsSync(ui_controls::MouseButton type,
- int state) WARN_UNUSED_RESULT;
-
// A WindowedNotificationObserver hard-wired to observe
// chrome::NOTIFICATION_TAB_ADDED.
class WindowedTabAddedNotificationObserver
@@ -311,51 +263,6 @@
DISALLOW_COPY_AND_ASSIGN(BrowserAddedObserver);
};
-// See SendKeyPressAndWait. This function additionally performs a check on the
-// NotificationDetails using the provided Details<U>.
-template <class U>
-bool SendKeyPressAndWaitWithDetails(
- const Browser* browser,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command,
- int type,
- const content::NotificationSource& source,
- const content::Details<U>& details) WARN_UNUSED_RESULT;
-
-template <class U>
-bool SendKeyPressAndWaitWithDetails(
- const Browser* browser,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command,
- int type,
- const content::NotificationSource& source,
- const content::Details<U>& details) {
- WindowedNotificationObserverWithDetails<U> observer(type, source);
-
- if (!SendKeyPressSync(browser, key, control, shift, alt, command))
- return false;
-
- observer.Wait();
-
- U my_details;
- if (!observer.GetDetailsFor(source.map_key(), &my_details))
- return false;
-
- return *details.ptr() == my_details && !testing::Test::HasFatalFailure();
-}
-
-// Hide a native window.
-void HideNativeWindow(gfx::NativeWindow window);
-
-// Show and focus a native window. Returns true on success.
-bool ShowAndFocusNativeWindow(gfx::NativeWindow window) WARN_UNUSED_RESULT;
-
// Takes a snapshot of the given render widget, rendered at |page_size|. The
// snapshot is set to |bitmap|. Returns true on success.
bool TakeRenderWidgetSnapshot(content::RenderWidgetHost* rwh,
@@ -368,22 +275,6 @@
bool TakeEntirePageSnapshot(content::RenderViewHost* rvh,
SkBitmap* bitmap) WARN_UNUSED_RESULT;
-// A combination of SendMouseMove to the middle of the view followed by
-// SendMouseEvents.
-void MoveMouseToCenterAndPress(
-#if defined(TOOLKIT_VIEWS)
- views::View* view,
-#elif defined(TOOLKIT_GTK)
- GtkWidget* widget,
-#elif defined(OS_IOS)
- UIView* view,
-#elif defined(OS_MACOSX)
- NSView* view,
-#endif
- ui_controls::MouseButton button,
- int state,
- const base::Closure& task);
-
#if defined(OS_WIN)
// Saves a snapshot of the entire screen to a file named
// ChromiumSnapshotYYYYMMDDHHMMSS.png to |directory|, returning true on success.
@@ -399,16 +290,6 @@
// Configures the geolocation provider to always return the given position.
void OverrideGeolocation(double latitude, double longitude);
-namespace internal {
-
-// A utility function to send a mouse click event in a closure. It's shared by
-// ui_controls_linux.cc and ui_controls_mac.cc
-void ClickTask(ui_controls::MouseButton button,
- int state,
- const base::Closure& followup);
-
-} // namespace internal
-
// Enumerates all history contents on the backend thread. Returns them in
// descending order by time.
class HistoryEnumerator {

Powered by Google App Engine
This is Rietveld 408576698