summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprachij@chromium.org <prachij@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 22:28:26 +0000
committerprachij@chromium.org <prachij@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 22:28:26 +0000
commit1afdaa8a93ed340d99c4e17e946b0065faf382d0 (patch)
treea7b19cb97d939d961fbec564a4a43c265a0c8b2a
parentd30f688f6cc0c2c414218ccbb97aa00da041f38c (diff)
downloadchromium_src-1afdaa8a93ed340d99c4e17e946b0065faf382d0.zip
chromium_src-1afdaa8a93ed340d99c4e17e946b0065faf382d0.tar.gz
chromium_src-1afdaa8a93ed340d99c4e17e946b0065faf382d0.tar.bz2
Fixed flakiness of multiprofile basic settings testcases.
BUG=130134 TEST=NONE NOTRY=TRUE Review URL: https://chromiumcodereview.appspot.com/10449079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139654 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/test/functional/multiprofile.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/test/functional/multiprofile.py b/chrome/test/functional/multiprofile.py
index 92d96b3..bb420ad 100755
--- a/chrome/test/functional/multiprofile.py
+++ b/chrome/test/functional/multiprofile.py
@@ -211,11 +211,11 @@ class MultiprofileTest(pyauto.PyUITest):
msg='Multi-profile is not enabled')
# Launch browser with new Profile 1, set startup page to 'www.google.com'.
self.OpenNewBrowserWindowWithNewProfile()
- self.assertEqual(2, self.GetBrowserWindowCount())
+ self.WaitUntil(self._CheckNumProfiles, args=[2])
self._SetStartUpPage('http://www.google.com', windex=1)
# Launch browser with new Profile 2, set startup page to 'www.yahoo.com'.
self.OpenNewBrowserWindowWithNewProfile()
- self.assertEqual(3, self.GetBrowserWindowCount())
+ self.WaitUntil(self._CheckNumProfiles, args=[3])
# Verify start up page for Profile 2 is still newtab page.
info = self.GetBrowserInfo()
self.assertEqual('chrome://newtab/', info['windows'][2]['tabs'][0]['url'])
@@ -234,11 +234,11 @@ class MultiprofileTest(pyauto.PyUITest):
msg='Multi-profile is not enabled')
# Launch browser with new Profile 1, set homepage to 'www.google.com'.
self.OpenNewBrowserWindowWithNewProfile()
- self.assertEqual(2, self.GetBrowserWindowCount())
+ self.WaitUntil(self._CheckNumProfiles, args=[2])
self._SetHomePage('http://www.google.com', windex=1)
# Launch browser with new Profile 2, set homepage to 'www.yahoo.com'.
self.OpenNewBrowserWindowWithNewProfile()
- self.assertEqual(3, self.GetBrowserWindowCount())
+ self.WaitUntil(self._CheckNumProfiles, args=[3])
self._SetHomePage('http://www.yahoo.com', windex=2)
# Exit Profile 1 / Profile 2
self.CloseBrowserWindow(1)
@@ -255,9 +255,11 @@ class MultiprofileTest(pyauto.PyUITest):
# Launch browser with new Profile 1, set pref to restore session on
# startup.
self.OpenNewBrowserWindowWithNewProfile()
+ self.WaitUntil(self._CheckNumProfiles, args=[2])
self._SetSessionRestoreURLs(self._RESTORE_LASTOPEN_URL_VALUE, windex=1)
# Launch browser with new Profile 2, do not set session restore pref.
self.OpenNewBrowserWindowWithNewProfile()
+ self.WaitUntil(self._CheckNumProfiles, args=[3])
self._SetSessionRestoreURLs(self._RESTORE_DEFAULT_URL_VALUE, windex=2)
# Exit Profile 1 / Profile 2
self.CloseBrowserWindow(1)
@@ -277,12 +279,12 @@ class MultiprofileTest(pyauto.PyUITest):
msg='Multi-profile is not enabled')
# Launch browser with new Profile 1, enable instant search
self.OpenNewBrowserWindowWithNewProfile()
- self.assertEqual(2, self.GetBrowserWindowCount())
+ self.WaitUntil(self._CheckNumProfiles, args=[2])
self.SetPrefs(pyauto.kInstantEnabled, True, windex=1)
self.assertTrue(self.GetPrefsInfo(windex=1).Prefs(pyauto.kInstantEnabled))
# Launch browser with new Profile 2.
self.OpenNewBrowserWindowWithNewProfile()
- self.assertEqual(3, self.GetBrowserWindowCount())
+ self.WaitUntil(self._CheckNumProfiles, args=[3])
# Exit Profile 1 / Profile 2
self.CloseBrowserWindow(1)
self.CloseBrowserWindow(2)
@@ -301,11 +303,13 @@ class MultiprofileTest(pyauto.PyUITest):
msg='Multi-profile is not enabled')
# Launch browser with new Profile 1, add search engine to 'Hulu'.
self.OpenNewBrowserWindowWithNewProfile()
+ self.WaitUntil(self._CheckNumProfiles, args=[2])
self._AddSearchEngine('Hulu', 'hulu.com',
'http://www.hulu.com/search?query=%s&ref=os&src={referrer:source?}', 1)
self.MakeSearchEngineDefault('hulu.com', windex=1)
# Launch browser with new Profile 2, add search engine to 'Youtube'.
self.OpenNewBrowserWindowWithNewProfile()
+ self.WaitUntil(self._CheckNumProfiles, args=[3])
self._AddSearchEngine('YouTube Video Search', 'youtube.com',
'http://www.youtube.com/results?search_query=%s&page={startPage?}'+
'&utm_source=opensearch', 2)
@@ -325,9 +329,11 @@ class MultiprofileTest(pyauto.PyUITest):
msg='Multi-profile is not enabled')
# Launch browser with new Profile 1, add 'foo.com' as new search engine.
self.OpenNewBrowserWindowWithNewProfile()
+ self.WaitUntil(self._CheckNumProfiles, args=[2])
self._AddSearchEngine('foo', 'foo.com', 'http://foo/?q=%s', windex=1)
# Launch browser with new Profile 2, add 'foo.com' as new search engine.
self.OpenNewBrowserWindowWithNewProfile()
+ self.WaitUntil(self._CheckNumProfiles, args=[3])
self._AddSearchEngine('foo', 'foo.com', 'http://foo/?q=%s', windex=2)
# Delete search engine 'foo.com' from Profile 1 and exit.
self.DeleteSearchEngine('foo.com', windex=1)