From 7944217da465b1c4948ff378364f40e7eaf5ce85 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sun, 20 Dec 2015 20:14:17 +0100 Subject: [PATCH] Adjust pdfjs unit tests for new logging level The script generation output was changed because we changed the logging level, this adjusts the unit tests to match the new output. --- tests/unit/browser/test_pdfjs.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/unit/browser/test_pdfjs.py b/tests/unit/browser/test_pdfjs.py index faaddcd21..88c6153c7 100644 --- a/tests/unit/browser/test_pdfjs.py +++ b/tests/unit/browser/test_pdfjs.py @@ -31,10 +31,17 @@ from qutebrowser.browser import pdfjs # because we use qutebrowser.browser.webelem.javascript_escape. Characters # like " are already replaced by QUrl. @pytest.mark.parametrize('url, expected', [ - ('http://foo.bar', 'PDFView.open("http://foo.bar");\n'), - ('http://"', 'PDFView.open("");\n'), - ('\0', 'PDFView.open("%00");\n'), + ('http://foo.bar', + 'PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.info;\n' + 'PDFView.open("http://foo.bar");\n'), + ('http://"', + 'PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.info;\n' + 'PDFView.open("");\n'), + ('\0', + 'PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.info;\n' + 'PDFView.open("%00");\n'), ('http://foobar/");alert("attack!");', + 'PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.info;\n' 'PDFView.open("http://foobar/%22);alert(%22attack!%22);");\n'), ]) def test_generate_pdfjs_script(url, expected):