Fix :fake-key with no focused webview.
This commit is contained in:
parent
4c1eff625f
commit
922fdc0526
@ -1779,7 +1779,7 @@ class CommandDispatcher:
|
||||
try:
|
||||
receiver = objreg.get('webview', scope='tab',
|
||||
tab='current')
|
||||
except KeyError:
|
||||
except objreg.RegistryUnavailableError:
|
||||
raise cmdexc.CommandError("No focused webview!")
|
||||
|
||||
QApplication.postEvent(receiver, press_event)
|
||||
|
@ -130,6 +130,17 @@ Feature: Various utility commands.
|
||||
Then the javascript message "key press: 88" should be logged
|
||||
And the javascript message "key release: 88" should be logged
|
||||
|
||||
@not_xvfb
|
||||
Scenario: :fake-key sending key to the website with other window focused
|
||||
When I open data/misc/fakekey.html
|
||||
And I set general -> developer-extras to true
|
||||
And I run :inspector
|
||||
And I wait for "Focus object changed: <PyQt5.QtWebKitWidgets.QWebView object at *>" in the log
|
||||
And I run :fake-key x
|
||||
And I run :inspector
|
||||
And I wait for "Focus object changed: <qutebrowser.browser.webview.WebView *>" in the log
|
||||
Then the error "No focused webview!" should be shown.
|
||||
|
||||
Scenario: :fake-key sending special key to the website
|
||||
When I set general -> log-javascript-console to true
|
||||
And I open data/misc/fakekey.html
|
||||
|
Loading…
Reference in New Issue
Block a user