mozilla/gaia-ui-tests — pull request #372 by jonallengriffin (2013-02-06 00:05:59+00:00)
Title: Fix getAllContacts when an error occurs

All the tests are failing on the panda right now with:

15:48:37 INFO - ERROR: test_get_all_settings (test_settings.TestSettings)
15:48:37 INFO - ----------------------------------------------------------------------
15:48:37 INFO - Traceback (most recent call last):
15:48:37 INFO - File "/builds/panda-0100/test/build/venv/lib/python2.7/site-packages/gaiatest/gaia_test.py", line 254, in setUp
15:48:37 INFO - self.cleanUp()
15:48:37 INFO - File "/builds/panda-0100/test/build/venv/lib/python2.7/site-packages/gaiatest/gaia_test.py", line 302, in cleanUp
15:48:37 INFO - self.data_layer.remove_all_contacts(self._script_timeout)
15:48:37 INFO - File "/builds/panda-0100/test/build/venv/lib/python2.7/site-packages/gaiatest/gaia_test.py", line 142, in remove_all_contacts
15:48:37 INFO - self.marionette.set_script_timeout(max(default_script_timeout, 1000 * len(self.all_contacts)))
15:48:37 INFO - TEST-UNEXPECTED-FAIL | test_settings.py TestSettings.test_get_all_settings | TypeError: object of type 'bool' has no len()

This occurs because getAllContacts is returning false when called from setUp(). If an error occurs here, I think we should return [] so that the test can continue.

I'm not sure *why* the error occurs here; it may be we're starting the tests before the contacts db is initialized or something.