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:
parent
962ba36cda
commit
bf3bd3bb9d
@ -90,6 +90,11 @@ def test_mhtml(test_name, download_dir, quteproc, httpbin):
|
|||||||
quteproc.open_path('{}/{}.html'.format(test_path, test_name))
|
quteproc.open_path('{}/{}.html'.format(test_path, test_name))
|
||||||
download_dest = os.path.join(download_dir.location,
|
download_dest = os.path.join(download_dir.location,
|
||||||
'{}-downloaded.mht'.format(test_name))
|
'{}-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
|
# Discard all requests that were necessary to display the page
|
||||||
httpbin.clear_data()
|
httpbin.clear_data()
|
||||||
quteproc.send_cmd(':download --mhtml --dest "{}"'.format(download_dest))
|
quteproc.send_cmd(':download --mhtml --dest "{}"'.format(download_dest))
|
||||||
|
Loading…
Reference in New Issue
Block a user