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

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

Issue 10913043: Convert the popups pyauto test to browser_tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/data/popup_blocker/popup-many.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/ui_test_utils.cc
===================================================================
--- chrome/test/base/ui_test_utils.cc (revision 154448)
+++ chrome/test/base/ui_test_utils.cc (working copy)
@@ -22,6 +22,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/autocomplete/autocomplete_controller.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/history_service_factory.h"
@@ -41,6 +42,8 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/find_bar/find_notification_details.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
+#include "chrome/browser/ui/omnibox/location_bar.h"
+#include "chrome/browser/ui/omnibox/omnibox_view.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
@@ -442,6 +445,20 @@
observer->WaitForFinished();
}
+void SendToOmniboxAndSubmit(LocationBar* location_bar,
+ const std::string& input) {
+ OmniboxView* omnibox = location_bar->GetLocationEntry();
+ omnibox->model()->OnSetFocus(false);
+ omnibox->SetUserText(ASCIIToUTF16(input));
+ location_bar->AcceptInput();
+ while (!omnibox->model()->autocomplete_controller()->done()) {
+ content::WindowedNotificationObserver observer(
+ chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY,
+ content::NotificationService::AllSources());
+ observer.Wait();
+ }
+}
+
bool GetNativeWindow(const Browser* browser, gfx::NativeWindow* native_window) {
BrowserWindow* window = browser->window();
if (!window)
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/data/popup_blocker/popup-many.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698