summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorace@chromium.org <ace@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-13 00:28:50 +0000
committerace@chromium.org <ace@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-13 00:28:50 +0000
commitd842dab5a7762823eea2d6c1ab1dffec4ca92129 (patch)
treeae947b1dfb6b87d4e727ba1c04b8a93a1a67ff9d /chrome
parent3ed09692223bd8a223379769f23adf1fbb56a4b2 (diff)
downloadchromium_src-d842dab5a7762823eea2d6c1ab1dffec4ca92129.zip
chromium_src-d842dab5a7762823eea2d6c1ab1dffec4ca92129.tar.gz
chromium_src-d842dab5a7762823eea2d6c1ab1dffec4ca92129.tar.bz2
Workaround for some pyauto test flakiness on linux. Tests that use the omnibox
immediately after creating a new window need to wait for it to be "ready" on linux. **remake of issue4838001 (nuked client, long story) BUG=62783,44203 Review URL: http://codereview.chromium.org/4931001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/functional/PYAUTO_TESTS1
-rw-r--r--chrome/test/functional/omnibox.py4
-rw-r--r--chrome/test/functional/search_engines.py1
-rw-r--r--chrome/test/pyautolib/pyauto.py16
4 files changed, 20 insertions, 2 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS
index 5f4d2a1..2a8c25c 100644
--- a/chrome/test/functional/PYAUTO_TESTS
+++ b/chrome/test/functional/PYAUTO_TESTS
@@ -80,7 +80,6 @@
],
'linux': [ # linux != chromeos
- '-omnibox', # http://crbug.com/44203
'-browser.BrowserTest.testWindowResize', # crbug.com/44963
'-content.ContentTest.testThreeWindows', # crbug.com/47457
],
diff --git a/chrome/test/functional/omnibox.py b/chrome/test/functional/omnibox.py
index 16bfba3..3ed88ed 100644
--- a/chrome/test/functional/omnibox.py
+++ b/chrome/test/functional/omnibox.py
@@ -29,6 +29,7 @@ class OmniboxTest(pyauto.PyUITest):
def testFocusOnStartup(self):
"""Verify that omnibox has focus on startup."""
+ self.WaitUntilOmniboxReadyHack()
self.assertTrue(self.GetOmniboxInfo().Properties('has_focus'))
def _GetOmniboxMatchesFor(self, text, windex=0, attr_dict=None):
@@ -72,9 +73,11 @@ class OmniboxTest(pyauto.PyUITest):
_VerifyHistoryResult([url, title], title)
# Verify results in another window
self.OpenNewBrowserWindow(True)
+ self.WaitUntilOmniboxReadyHack(windex=1)
_VerifyHistoryResult([url, title], title, windex=1)
# Verify results in an incognito window
self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
+ self.WaitUntilOmniboxReadyHack(windex=2)
_VerifyHistoryResult([url, title], title, windex=2)
def testSelect(self):
@@ -213,4 +216,3 @@ class OmniboxTest(pyauto.PyUITest):
if __name__ == '__main__':
pyauto_functional.Main()
-
diff --git a/chrome/test/functional/search_engines.py b/chrome/test/functional/search_engines.py
index ee6715d8..d78edfd 100644
--- a/chrome/test/functional/search_engines.py
+++ b/chrome/test/functional/search_engines.py
@@ -131,6 +131,7 @@ class SearchEnginesTest(pyauto.PyUITest):
# Test tab to search in an incognito window.
self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
+ self.WaitUntilOmniboxReadyHack(windex=1)
self.SetOmniboxText('google.com\tincognito', 1)
self.OmniboxAcceptInput(1)
loc = self.GetActiveTabURL(1).spec()
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index dee070a..8545f65 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -438,6 +438,22 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
self._GetResultFromJSONRequest(cmd_dict, windex=windex)
+ # TODO(ace): Remove this hack, update bug 62783.
+ def WaitUntilOmniboxReadyHack(self, windex=0):
+ """Wait until the omnibox is ready for input.
+
+ This is a hack workaround for linux platform, which returns from
+ synchronous window creation methods before the omnibox is fully functional.
+
+ No-op on non-linux platforms.
+
+ Args:
+ windex: the index of the browser to work on.
+ """
+ if self.IsLinux():
+ return self.WaitUntil(
+ lambda : self.GetOmniboxInfo(windex).Properties('has_focus'))
+
def WaitUntilOmniboxQueryDone(self, windex=0):
"""Wait until omnibox has finished populating results.