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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 | 199 |
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 def _NavigateAndRecord(): |
210 self.NavigateToURL(url) | |
craigdh
2012/08/17 00:29:49
Do you need to navigate every time you try this? O
Nirnimesh
2012/08/17 00:39:19
Done.
| |
211 return len(self.GetHistoryInfo().History()) | |
212 # chromeos often takes a while to register URLs into history. | |
213 self.assertTrue(self.WaitUntil(_NavigateAndRecord), | |
214 msg='Could not open %s successfully' % url) | |
210 open('/home/chronos/__magic__', 'w').close() | 215 open('/home/chronos/__magic__', 'w').close() |
211 open('/home/chronos/user/__magic__', 'w').close() | 216 open('/home/chronos/user/__magic__', 'w').close() |
212 | 217 |
213 def _VerifyProfile(): | 218 def _VerifyProfile(): |
214 history = self.GetHistoryInfo().History() | 219 history = self.GetHistoryInfo().History() |
215 self.assertEqual(1, len(history)) | 220 self.assertEqual(1, len(history)) |
216 self.assertEqual(url, history[0]['url']) | 221 self.assertEqual(url, history[0]['url']) |
217 self.assertTrue(os.path.exists('/home/chronos/__magic__'), | 222 self.assertTrue(os.path.exists('/home/chronos/__magic__'), |
218 msg='/home/chronos/__magic__ did not persist across login sessions') | 223 msg='/home/chronos/__magic__ did not persist across login sessions') |
219 self.assertTrue(os.path.exists('/home/chronos/user/__magic__'), | 224 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.') | 253 msg='Could not find "help_advanced" in help output.') |
249 | 254 |
250 # Exit crosh and close tab. | 255 # Exit crosh and close tab. |
251 self.SendKeysToHterm('exit\\n') | 256 self.SendKeysToHterm('exit\\n') |
252 self.WaitForHtermText(text='command crosh completed with exit code 0', | 257 self.WaitForHtermText(text='command crosh completed with exit code 0', |
253 msg='Could not exit crosh.') | 258 msg='Could not exit crosh.') |
254 | 259 |
255 | 260 |
256 if __name__ == '__main__': | 261 if __name__ == '__main__': |
257 pyauto_functional.Main() | 262 pyauto_functional.Main() |
OLD | NEW |