From bf3bd3bb9d925efd05c3d5a88ca6ed9c1de30ebd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 27 Nov 2015 19:30:06 +0100 Subject: [PATCH] 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 --- tests/integration/test_mhtml_e2e.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/integration/test_mhtml_e2e.py b/tests/integration/test_mhtml_e2e.py index 090937186..fee9e1677 100644 --- a/tests/integration/test_mhtml_e2e.py +++ b/tests/integration/test_mhtml_e2e.py @@ -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))