Wait for favicon to be loaded for mhtml tests.

This hopefully helps with the flaky MHTML tests on Windows where the favicon
was loaded *after* clearing the requests:

http://qutebrowser.org:8010/builders/win8/builds/1370/steps/unittests-frozen/logs/stdio
This commit is contained in:
Florian Bruhin 2015-11-27 19:30:06 +01:00
parent 962ba36cda
commit bf3bd3bb9d

View File

@ -90,6 +90,11 @@ def test_mhtml(test_name, download_dir, quteproc, httpbin):
quteproc.open_path('{}/{}.html'.format(test_path, test_name))
download_dest = os.path.join(download_dir.location,
'{}-downloaded.mht'.format(test_name))
# Wait for favicon.ico to be loaded if there is one
if os.path.exists(os.path.join(test_dir, 'favicon.png')):
httpbin.wait_for(path='/{}/favicon.png'.format(test_path))
# Discard all requests that were necessary to display the page
httpbin.clear_data()
quteproc.send_cmd(':download --mhtml --dest "{}"'.format(download_dest))