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

Side by Side Diff: chrome/test/functional/chromeos_login.py

Issue 10829367: [chromeos] Make testProfilePreservedBetweenLogins test robust (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import subprocess 7 import subprocess
8 import sys 8 import sys
9 9
10 import pyauto_functional # Must be imported before pyauto 10 import pyauto_functional # Must be imported before pyauto
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 def testProfilePreservedBetweenLogins(self): 200 def testProfilePreservedBetweenLogins(self):
201 """Verify that profile is preserved between two login sessions. 201 """Verify that profile is preserved between two login sessions.
202 202
203 Also verify Local State. 203 Also verify Local State.
204 """ 204 """
205 self.testGoodLogin() 205 self.testGoodLogin()
206 206
207 # Build up some history and setup state in "Local State". 207 # Build up some history and setup state in "Local State".
208 url = self.GetHttpURLForDataPath('title2.html') 208 url = self.GetHttpURLForDataPath('title2.html')
209 self.NavigateToURL(url) 209 self.NavigateToURL(url)
210 # chromeos often takes a while to register URLs into history.
211 self.assertTrue(self.WaitUntil(lambda: self.GetHistoryInfo().History()),
212 msg='Could not open %s successfully' % url)
210 open('/home/chronos/__magic__', 'w').close() 213 open('/home/chronos/__magic__', 'w').close()
211 open('/home/chronos/user/__magic__', 'w').close() 214 open('/home/chronos/user/__magic__', 'w').close()
212 215
213 def _VerifyProfile(): 216 def _VerifyProfile():
214 history = self.GetHistoryInfo().History() 217 history = self.GetHistoryInfo().History()
215 self.assertEqual(1, len(history)) 218 self.assertEqual(1, len(history))
216 self.assertEqual(url, history[0]['url']) 219 self.assertEqual(url, history[0]['url'])
217 self.assertTrue(os.path.exists('/home/chronos/__magic__'), 220 self.assertTrue(os.path.exists('/home/chronos/__magic__'),
218 msg='/home/chronos/__magic__ did not persist across login sessions') 221 msg='/home/chronos/__magic__ did not persist across login sessions')
219 self.assertTrue(os.path.exists('/home/chronos/user/__magic__'), 222 self.assertTrue(os.path.exists('/home/chronos/user/__magic__'),
(...skipping 28 matching lines...) Expand all
248 msg='Could not find "help_advanced" in help output.') 251 msg='Could not find "help_advanced" in help output.')
249 252
250 # Exit crosh and close tab. 253 # Exit crosh and close tab.
251 self.SendKeysToHterm('exit\\n') 254 self.SendKeysToHterm('exit\\n')
252 self.WaitForHtermText(text='command crosh completed with exit code 0', 255 self.WaitForHtermText(text='command crosh completed with exit code 0',
253 msg='Could not exit crosh.') 256 msg='Could not exit crosh.')
254 257
255 258
256 if __name__ == '__main__': 259 if __name__ == '__main__':
257 pyauto_functional.Main() 260 pyauto_functional.Main()
OLDNEW
« 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