Commit Graph

10433 Commits

Author SHA1 Message Date
Ryan Roden-Corrent
6646bbfe1f Test config completion with a ValueList.
The help, section, and option completion models behavee differently
with a ValueList than with a KeyValue, but previously we only tested
KeyValue.
2016-09-14 17:26:56 -04:00
Ryan Roden-Corrent
657859524f Make completion/test_models more rigorous.
It was checking that every expected item was in the actual item list,
but not visa-versa. This meant that extra completion items could show
up without failing the test.

This caught one bad test case. Bind completion includes aliases, but
the test did not expect this.
2016-09-14 17:26:56 -04:00
Florian Bruhin
5bef7dc74c Use file with known mimetype for qutescheme test 2016-09-14 16:48:49 +02:00
Florian Bruhin
c071964091 Fix lint 2016-09-14 15:21:30 +02:00
Florian Bruhin
886103c887 Fix showing errors in the current window 2016-09-14 15:18:12 +02:00
Florian Bruhin
0c278bc31d Improve Archlinux section in stacktrace.asciidoc 2016-09-14 12:42:19 +02:00
Florian Bruhin
e2318c6ba3 Update stacktrace docs 2016-09-14 12:33:47 +02:00
Florian Bruhin
982d00ff84 Let qute:* handlers decide their mimetype
This means we have to guess less, and handlers can give us HTML as text
which we then encode for them.
2016-09-14 12:33:20 +02:00
Florian Bruhin
3a27c45ac9 More cleanup in test_webkitqutescheme 2016-09-14 12:08:35 +02:00
Florian Bruhin
5b527d0f1e Rename test_qutescheme to test_webkitqutescheme 2016-09-14 12:07:26 +02:00
Florian Bruhin
cc1e134f25 Fix test_qutescheme.py 2016-09-14 12:05:15 +02:00
Florian Bruhin
5501d90268 Fix lint 2016-09-14 12:00:29 +02:00
Florian Bruhin
c128aba27e Fix qute:* handlers in run_vulture.py 2016-09-14 11:39:19 +02:00
Florian Bruhin
0657eeb8f4 Activate QtWebEngine tests for qute:* 2016-09-14 11:14:04 +02:00
Florian Bruhin
a1527f35d4 Allow to restrict qute:* pages to a backend 2016-09-14 11:04:47 +02:00
Florian Bruhin
71bc5bb943 Move QuteSchemeError to qutescheme 2016-09-14 11:04:37 +02:00
Florian Bruhin
aa71c9ae58 Initial qute:* support for QtWebEngine 2016-09-14 10:18:25 +02:00
Florian Bruhin
4a14083507 Fix :jseval --world contitional in set_text_field
See #1942
2016-09-13 07:59:21 +02:00
Ryan Roden-Corrent
e23d611b37 Strip quotes from completion pattern.
Given a commandline like:
`:set general editor "gvim -f"|`, the pattern should be 'gvim -f'
rather than '"gvim -f"'.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
e65aba74fd Test pattern for Completion.update_completion.
In the update_completion unit test, verify the `pattern` parameter as
well as the `model`.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
b867b87955 Don't crash Completer on unknown command.
The CommandRunner's fallback parsing behavior treated whitespace
differently than the normal flow. When a user entered an unknown
command, trailing whitespace would be stripped and the cmdline length
would be less than the cursor position.

This is fixed by making the fallback use the ShellLexer just as the
'normal' parsing does.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
69a3df174d Remove needless try/catch in on_selection_changed. 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
52fdad8186 Test on_selection_changed with maxsplit 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
d651cc75b0 Fix flake8/pylint errors. 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
808a645b40 Fix quick-complete highlighting quirk.
When the commandline reads ':open |', quick-completing the only offered
completion will set the commandline to ':open some_url |'. Since `open`
has `maxsplit=0`, everything after ':open' is (correctly) treated as
one argument. This means completion is opened again with 'some url '
as the pattern (note trailing whitespace), which makes the comletion
menu 'flicker' and stay open even though it was 'supposed' to quick
compelte.

This is fixed by ignoring the next completion request if we just
completed something after maxsplit (because we don't expect any more
completions after the last split).

Resolves #1519.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
fcadde6aef Merge _split into _partition in Completer.
After the refactoring, _split is only called by _partition so just make
it part of the same method. This also removes the use of
_empty_item_index, as it can be figured out on the fly.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
127412d91c Simplify update_completion.
Remove the class variables _cursor_part and _empty_item_index. Instead,
split up the commandline around the cursor whenever that information is
needed. Using locals instead of class variables makes the logic easier
to follow and ends up requiring much less code.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
581d7659ba Clean up Completer.on_selection_changed.
Remove the dependency on the class variables _empty_item_index
and _cursor_part to make the code easier to follow. If
_update_completion is refactored in a similar way these variables can
be removed.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
eb384fdda0 Better Completer.on_selection_changed testing.
Preparation for refactoring.
2016-09-12 22:19:44 -04:00
Florian Bruhin
e4192b5158 Yet another flaky test... 2016-09-12 22:49:55 +02:00
Florian Bruhin
1f10c7ff94 Fix broken hint test
The wait we added a few commits earlier was just plain wrong, filtering
the strings isn't going to print that, and shouldn't happen async
anyways...
2016-09-12 22:00:54 +02:00
Florian Bruhin
0b310d6910 Fix removing of a clicked download 2016-09-12 21:47:01 +02:00
Florian Bruhin
5b0fc41367 Log scroll data we got via JS 2016-09-12 21:46:51 +02:00
Florian Bruhin
11abb642ab Remove downloading test with deleting handler
This actually is kind of tricky, and it makes later tests fail because
the tmpdir is suddenly gone...
2016-09-12 20:53:01 +02:00
Florian Bruhin
54c32cc74e Fix long line 2016-09-12 20:41:51 +02:00
Florian Bruhin
07e67740cc Add missing jseval.html 2016-09-12 20:02:03 +02:00
Florian Bruhin
4b4582c452 Adjust comment in _rect_on_view_js 2016-09-12 20:00:59 +02:00
Florian Bruhin
e6680c3c60 Also redirect $HOME for QtWebEngine tests
See https://github.com/The-Compiler/qutebrowser/pull/1637#issuecomment-243043811
2016-09-12 19:55:31 +02:00
Florian Bruhin
08e95f76a6 QtWebEngine: Stabilize/reactivate two hint tests 2016-09-12 18:59:37 +02:00
Florian Bruhin
516bfb5ba3 Un-flaky another test waiting for scrolling 2016-09-12 18:58:31 +02:00
Florian Bruhin
c40325b510 Stabilize "Jumping back after searching" test
The test was flaky because waiting for scrolling didn't actually wait,
as the page logged a scroll position change to 0/0 directly after
loading.

We work around this by making the generic "And I wait until the scroll
position changed" not wait when it changed to 0/0.
2016-09-12 18:53:56 +02:00
Florian Bruhin
14de9f58b8 Fix docstring 2016-09-12 18:33:57 +02:00
Florian Bruhin
9e20e3a802 Skip :jseval with world tests for PyQt < 5.7.0 2016-09-12 18:30:49 +02:00
Florian Bruhin
8a35ebac7b Use a separate JS world for :jseval 2016-09-12 18:27:51 +02:00
Florian Bruhin
c9e3cc04cf Accept a name for --world with :jseval 2016-09-12 18:23:23 +02:00
Florian Bruhin
97edc59f03 Add some logging to argparse.multitype_conv 2016-09-12 18:22:49 +02:00
Florian Bruhin
2281f0c790 Fix :insert-text test for QtWebEngine 2016-09-12 15:59:23 +02:00
Florian Bruhin
b2608d7697 Add --world to :jseval 2016-09-12 15:59:17 +02:00
Florian Bruhin
a16c5a6a25 Add a world argument to tab.run_js_async 2016-09-12 15:59:03 +02:00
Florian Bruhin
fa78cc9f69 tests: Allow to mark JS errors as expected 2016-09-12 15:57:02 +02:00