OLD | NEW |
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 Loading... |
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 Loading... |
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() |
OLD | NEW |