summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-11-24 10:56:07 +0100
committerFlorian Bruhin <me@the-compiler.org>2022-11-24 14:12:38 +0100
commitf6e4ba3d6f86de17f18a01383f7e830fab90197d (patch)
tree6352558918f1cc70901c1b71ccc6eda58403bc4f
parent9ad13fa50895a206663893fe3478c4b3eae78baa (diff)
downloadqutebrowser-f6e4ba3d6f86de17f18a01383f7e830fab90197d.tar.gz
qutebrowser-f6e4ba3d6f86de17f18a01383f7e830fab90197d.zip
Make skipping broken PDF.js work properly
Fixup for c7ea2f705f22cfb677ef1b32ce3ec7101cede137 See #7135
-rw-r--r--tests/end2end/features/conftest.py4
-rw-r--r--tests/end2end/features/downloads.feature2
-rw-r--r--tests/end2end/features/qutescheme.feature4
-rw-r--r--tests/end2end/fixtures/quteprocess.py2
-rw-r--r--tests/end2end/fixtures/test_quteprocess.py1
5 files changed, 7 insertions, 6 deletions
diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py
index 96e04a9fb..c1089ecff 100644
--- a/tests/end2end/features/conftest.py
+++ b/tests/end2end/features/conftest.py
@@ -437,12 +437,12 @@ def update_documentation():
subprocess.run([sys.executable, update_script], check=True)
-@bdd.when("I wait until PDF.js is loaded")
+@bdd.when("I wait until PDF.js is ready")
def wait_pdfjs(quteproc):
quteproc.wait_for(message="load status for <qutebrowser.browser.* "
"tab_id=* url='qute://pdfjs/web/viewer.html?*'>: LoadStatus.success")
try:
- quteproc.wait_for(message="[qute://pdfjs/web/viewer.html?*] Uncaught TypeError: Cannot read property 'set' of undefined", timeout=100)
+ quteproc.wait_for(message="JS: [qute://pdfjs/web/viewer.html?*] Uncaught TypeError: Cannot read property 'set' of undefined", timeout=100)
except testprocess.WaitForTimeout:
pass
else:
diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature
index 9ed77f317..6969f50dc 100644
--- a/tests/end2end/features/downloads.feature
+++ b/tests/end2end/features/downloads.feature
@@ -646,7 +646,7 @@ Feature: Downloading things from a website.
When I set downloads.location.prompt to false
And I set content.pdfjs to true
And I open data/misc/test.pdf without waiting
- And I wait until PDF.js is loaded
+ And I wait until PDF.js is ready
And I run :click-element id download
And I wait until the download is finished
# We get viewer.html as name on QtWebKit...
diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature
index 1753aa264..c5285b221 100644
--- a/tests/end2end/features/qutescheme.feature
+++ b/tests/end2end/features/qutescheme.feature
@@ -176,7 +176,7 @@ Feature: Special qute:// pages
Given pdfjs is available
When I set content.pdfjs to true
And I open data/misc/test.pdf without waiting
- And I wait until PDF.js is loaded
+ And I wait until PDF.js is ready
# No "Then"
@qtwebkit_pdf_imageformat_skip
@@ -191,7 +191,7 @@ Feature: Special qute:// pages
When I set content.pdfjs to true
And I set downloads.location.prompt to true
And I open data/misc/test.pdf without waiting
- And I wait until PDF.js is loaded
+ And I wait until PDF.js is ready
And I run :jseval document.getElementById("download").click()
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default=* mode=<PromptMode.download: 5> option=None text=* title='Save file to:'>, *" in the log
And I run :mode-leave
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py
index 21389edca..fd0dd8708 100644
--- a/tests/end2end/fixtures/quteprocess.py
+++ b/tests/end2end/fixtures/quteprocess.py
@@ -438,7 +438,7 @@ class QuteProc(testprocess.Process):
except AttributeError:
pass
else:
- if call.failed or hasattr(call, 'wasxfail'):
+ if call.failed or hasattr(call, 'wasxfail') or call.skipped:
super().after_test()
return
diff --git a/tests/end2end/fixtures/test_quteprocess.py b/tests/end2end/fixtures/test_quteprocess.py
index 0620dbf6d..7199bf015 100644
--- a/tests/end2end/fixtures/test_quteprocess.py
+++ b/tests/end2end/fixtures/test_quteprocess.py
@@ -35,6 +35,7 @@ class FakeRepCall:
def __init__(self):
self.failed = False
+ self.skipped = False
class FakeConfig: