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

Unified Diff: chrome/test/functional/omnibox.py

Issue 10860022: Disable suggest field trial in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use group 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/omnibox.py
diff --git a/chrome/test/functional/omnibox.py b/chrome/test/functional/omnibox.py
index aa3305d13d839aed0bce63be77beb8c6fd7aad12..4efc36755793cd24d4528e3761bc19513f0fde15 100755
--- a/chrome/test/functional/omnibox.py
+++ b/chrome/test/functional/omnibox.py
@@ -117,21 +117,6 @@ class OmniboxTest(pyauto.PyUITest):
self.OmniboxAcceptInput()
self.assertEqual(title1, self.GetActiveTabTitle())
- def testGoogleSearch(self):
- """Verify Google search item in omnibox results."""
- search_text = 'hello world'
- verify_str = 'Google Search'
- url_re = 'http://www.google.com/search\?.*q=hello\+world.*'
- matches_description = test_utils.GetOmniboxMatchesFor(
- self, search_text, attr_dict={'description': verify_str})
- self.assertTrue(matches_description)
- # There should be a least one entry with the description Google. Suggest
- # results may end up having 'Google Search' in them, so use >=.
- self.assertTrue(len(matches_description) >= 1)
- item = matches_description[0]
- self.assertTrue(re.search(url_re, item['destination_url']))
- self.assertEqual('search-what-you-typed', item['type'])
-
def testInlineAutoComplete(self):
"""Verify inline autocomplete for a pre-visited URL."""
self.NavigateToURL('http://www.google.com')
@@ -527,5 +512,34 @@ class OmniboxTest(pyauto.PyUITest):
self._VerifyAppSearchNewTab(app_name, search_str, app_url)
+class OmniboxLiveTest(pyauto.PyUITest):
+ """Test cases for the omnibox that hit live servers (such as Google)."""
+
+ def ExtraChromeFlags(self):
+ """Override default list of extra flags used in pyauto tests."""
+ # Force the suggest field trial group. This doesn't guarantee that there
+ # will be no experimental behaviour, but there's no other way to disable
+ # all suggest field trials at the moment. TODO(mpearson): Consider allowing
+ # the suggest_url to be overridden using a flag (so that we can omit the
+ # "sugexp=chrome,mod=<n>" CGI param), or provide some other way to turn off
+ # all suggest field trials.
+ return ['--force-fieldtrials=OmniboxSearchSuggest/10/']
+
+ def testGoogleSearch(self):
+ """Verify Google search item in omnibox results."""
+ search_text = 'hello world'
+ verify_str = 'Google Search'
+ url_re = 'http://www.google.com/search\?.*q=hello\+world.*'
+ matches_description = test_utils.GetOmniboxMatchesFor(
+ self, search_text, attr_dict={'description': verify_str})
+ self.assertTrue(matches_description)
+ # There should be a least one entry with the description Google. Suggest
+ # results may end up having 'Google Search' in them, so use >=.
+ self.assertTrue(len(matches_description) >= 1)
+ item = matches_description[0]
+ self.assertTrue(re.search(url_re, item['destination_url']))
+ self.assertEqual('search-what-you-typed', item['type'])
+
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698