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

Unified Diff: chrome/browser/policy/policy_browsertest.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
Index: chrome/browser/policy/policy_browsertest.cc
===================================================================
--- chrome/browser/policy/policy_browsertest.cc (revision 154448)
+++ chrome/browser/policy/policy_browsertest.cc (working copy)
@@ -117,19 +117,6 @@
EXPECT_TRUE(result);
}
-void SendToOmniboxAndSubmit(LocationBar* location_bar, const string16& input) {
- OmniboxView* omnibox = location_bar->GetLocationEntry();
- omnibox->model()->OnSetFocus(false);
- omnibox->SetUserText(input);
- location_bar->AcceptInput();
- while (!omnibox->model()->autocomplete_controller()->done()) {
- content::WindowedNotificationObserver observer(
- chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY,
- content::NotificationService::AllSources());
- observer.Wait();
- }
-}
-
// Downloads a file named |file| and expects it to be saved to |dir|, which
// must be empty.
void DownloadAndVerifyFile(
@@ -274,7 +261,7 @@
// Verify that searching from the omnibox uses kSearchURL.
chrome::FocusLocationBar(browser());
LocationBar* location_bar = browser()->window()->GetLocationBar();
- SendToOmniboxAndSubmit(location_bar, ASCIIToUTF16("stuff to search for"));
+ ui_test_utils::SendToOmniboxAndSubmit(location_bar, "stuff to search for");
OmniboxEditModel* model = location_bar->GetLocationEntry()->model();
EXPECT_TRUE(model->CurrentMatch().destination_url.is_valid());
content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
@@ -288,7 +275,7 @@
EXPECT_TRUE(service->GetDefaultSearchProvider());
provider_.UpdateChromePolicy(policies);
EXPECT_FALSE(service->GetDefaultSearchProvider());
- SendToOmniboxAndSubmit(location_bar, ASCIIToUTF16("should not work"));
+ ui_test_utils::SendToOmniboxAndSubmit(location_bar, "should not work");
// This means that submitting won't trigger any action.
EXPECT_FALSE(model->CurrentMatch().destination_url.is_valid());
EXPECT_EQ(GURL("about:blank"), web_contents->GetURL());
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/popup_blocker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698