Commit Graph

6985 Commits

Author SHA1 Message Date
Florian Bruhin
7780fde62f Use different headers. 2016-01-15 07:53:01 +01:00
Florian Bruhin
be903e0c2f Merge branch 'patch-1' of https://github.com/Link-Satonaka/qutebrowser into Link-Satonaka-patch-1 2016-01-15 07:50:23 +01:00
Florian Bruhin
79cf6fa095 Merge branch 'Evidlo-master' 2016-01-15 07:48:37 +01:00
Florian Bruhin
b859bde9dc Regenerate authors. 2016-01-15 07:42:56 +01:00
Florian Bruhin
f1c31233c8 Merge branch 'master' of https://github.com/Evidlo/qutebrowser into Evidlo-master 2016-01-15 07:42:47 +01:00
Florian Bruhin
6774894e9e tests: Check HTTP server status per path.
Stricter and simpler, ha! :)
2016-01-15 07:13:45 +01:00
Florian Bruhin
9d520b7312 Avoid trying to load .netrc if $HOME isn't set.
This logged an error on Windows:

ERROR    misc       networkmanager:on_authentication_required:269 Unable to read the netrc file
Traceback (most recent call last):
  File "c:\python34\Lib\netrc.py", line 27, in __init__
    file = os.path.join(os.environ['HOME'], ".netrc")
  File "C:\Users\florian\buildbot\slave\win8\build\.tox\py34\lib\os.py", line 633, in __getitem__
    raise KeyError(key) from None
KeyError: 'HOME'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\florian\buildbot\slave\win8\build\qutebrowser\browser\network\networkmanager.py", line 262, in on_authentication_required
    net = netrc.netrc()
  File "c:\python34\Lib\netrc.py", line 29, in __init__
    raise OSError("Could not find .netrc: $HOME is not set")

Since this case is pretty common, we don't want to log it - and checking the
variable beforehand is easier than parsing the exception message.

This should fix the failing tests on Windows.
2016-01-15 06:57:43 +01:00
Florian Bruhin
40721a2b6b bdd: Wait until basic-auth page is fully loaded.
This hopefully fixes this flakyness in
test_successful_webpage_authentification:

    tests/integration/features/test_prompts.py:129:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    [...]
    tests/integration/features/conftest.py:381: in check_contents_json
	actual = json.loads(content)
    /usr/lib/python3.4/json/__init__.py:318: in loads
	return _default_decoder.decode(s)
    /usr/lib/python3.4/json/decoder.py:343: in decode
	obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    [...]
    >           raise ValueError(errmsg("Expecting value", s, err.value)) from None
    E           ValueError: Expecting value: line 1 column 1 (char 0)
2016-01-15 06:51:48 +01:00
Florian Bruhin
6420cdaa26 bdd: Open geolocation/notification page in new tab
This hopefully fixes this flaky error in test_notifications_with_ask__true on
OS X:

    Failed: Logged unexpected errors:

    LogLine('22:40:06 DEBUG    js         webpage:javaScriptConsoleMessage:531 [http://localhost:57758/data/prompt/notifications.html:28] [FAIL] unknown initial value for Notification.permission: denied')
    [...]
    testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Entering mode KeyMode.* (reason: question asked)'}.
2016-01-15 06:44:01 +01:00
evan
982ac5150d issue 1213: Display yanked link in statusbar
copied string format from `yank()` in `commands.py`
2016-01-14 19:17:12 -05:00
Florian Bruhin
5856b24d20 bdd: Compare HTTP status to a whitelist.
401 (authorization required) is not < 400, and it makes more sense to be strict
here anyways.
2016-01-14 22:34:26 +01:00
Florian Bruhin
cda6d7c06d bdd: Add test for webpage authentication. 2016-01-14 22:27:09 +01:00
Florian Bruhin
573654ece1 bdd: Add check_contents_json. 2016-01-14 22:27:00 +01:00
Florian Bruhin
c79f013050 bdd: Allow to load a page without waiting for it. 2016-01-14 22:26:42 +01:00
Florian Bruhin
23107a242b bdd: Ignore POSITION_UNAVAILABLE for geolocation. 2016-01-14 20:40:46 +01:00
Florian Bruhin
0b116729f7 bdd: Fix skipping tests from JS.
With the previous solution, we'd call pytest.skip on teardown only, which means
the rest of the test (e.g. because of a wait_for) could still fail.
2016-01-14 20:32:17 +01:00
Florian Bruhin
d4e2ece38b bdd: Ignore QGeoClue errors.
The geolocation tests emitted those errors on the Archlinux buildbot:

    QGeoclueMaster error creating GeoclueMasterClient.
    Geoclue error: Process org.freedesktop.Geoclue.Master exited with status 127

I don't really know what they mean, but let's see if the test passes now.
2016-01-14 19:06:36 +01:00
Florian Bruhin
b8a50dc475 bdd: Log error code on geolocation errors. 2016-01-14 19:04:48 +01:00
Florian Bruhin
e7a816c0c0 bdd: Skip geolocation tests if it's unavailable.
This should unbreak the build with older Qt versions.
2016-01-14 18:51:28 +01:00
Florian Bruhin
9c87eaf371 bdd: Allow to skip a test from JS.
This is a bit tricky since the test will actually run, but be marked as
skipped. The problem is we can't raise a pytest.skip.Exception during a test,
or it'll show up as an exception in a virtual Qt method.

Still this is better than nothing.
2016-01-14 18:50:36 +01:00
Florian Bruhin
14ff684e99 bdd: Add a xfail_norun marker. 2016-01-14 07:53:00 +01:00
Florian Bruhin
cf09e477a4 bdd: Add some tests for HTML5 notifications. 2016-01-14 07:49:39 +01:00
Florian Bruhin
1ddf817f4c bdd: Add some tests for geolocation. 2016-01-14 07:30:52 +01:00
Florian Bruhin
252dc5bf1b bdd: Add ability to fail tests from javascript. 2016-01-14 07:03:55 +01:00
Florian Bruhin
1d63e2dff4 bdd: Make "I wait for a prompt" step explicit. 2016-01-14 07:03:55 +01:00
Link
2e281a19d3 bullets 2016-01-13 17:51:21 -05:00
Link
082a910250 words 2016-01-13 17:50:02 -05:00
Link
4f5e59d6f8 Mention chocolatey and packagemanagement/onget 2016-01-13 17:19:51 -05:00
Florian Bruhin
abcb366c12 bdd: Add some more SSL tests. 2016-01-13 22:36:45 +01:00
Florian Bruhin
d0fda5467a bdd: Add a "I wait for a prompt" step. 2016-01-13 22:36:45 +01:00
Florian Bruhin
9c2a38938d bdd: Clear SSL errors before SSL test. 2016-01-13 22:36:45 +01:00
Florian Bruhin
0e631a2c11 bdd: Mark should_be_logged messages as expected. 2016-01-13 22:36:45 +01:00
Florian Bruhin
0203bb3ed5 Add a :debug-clear-ssl-errors command. 2016-01-13 21:05:48 +01:00
Florian Bruhin
2fbf218a0f bdd: Use textwrap.dedent. 2016-01-13 18:29:14 +01:00
Florian Bruhin
6014a963d4 Merge branch 'hcraT-master' 2016-01-13 18:22:15 +01:00
Florian Bruhin
f61b9fd42c Update docs. 2016-01-13 18:20:44 +01:00
Florian Bruhin
7ccc58bb68 Remove empty line. 2016-01-13 18:13:16 +01:00
Florian Bruhin
6c916d166d Merge branch 'master' of https://github.com/hcraT/qutebrowser into hcraT-master 2016-01-13 18:12:37 +01:00
Florian Bruhin
6b7f9fad9e Fix ssl-strict = ask.
This was introduced in b13f2aa6f0.
2016-01-13 15:54:25 +01:00
Florian Bruhin
b13f2aa6f0 Also deduplicate SSL errors with ssl-strict false.
Otherwise, on OS X we got the same SSL error logged twice as on_ssl_errors is
called twice. This means the tests only marked one as expected, and it failed
because of the other one.
2016-01-13 07:52:12 +01:00
Florian Bruhin
00f5b3cf74 Log debug information on SSL errors. 2016-01-13 07:52:12 +01:00
Florian Bruhin
e17a332400 Fix lint. 2016-01-13 07:01:31 +01:00
Florian Bruhin
0ca9cd361a Fix webserver_sub_ssl file header. 2016-01-13 00:00:55 +01:00
Florian Bruhin
f515165140 Add docstring. 2016-01-12 23:51:36 +01:00
Florian Bruhin
5f2ca88176 bdd: Don't test exact SSL error text.
Turns out those are platform specific.
2016-01-12 23:50:25 +01:00
Florian Bruhin
9479b65d25 bdd: Add first SSL test. 2016-01-12 23:35:48 +01:00
Florian Bruhin
8dd7f080f4 tests: Default to 5s timeout if not on CI. 2016-01-12 22:49:54 +01:00
Florian Bruhin
adbdfcbad3 tests: Add an SSL server subprocess. 2016-01-12 22:48:38 +01:00
Florian Bruhin
25dbf3731b tests: Split wait_for_load_finished from open_path. 2016-01-12 22:47:09 +01:00
Florian Bruhin
df03099468 Fix completion for String config type.
Since 2a705e2eb6 non-specialized config types are
String. However, String had an overloaded complete() which defaulted to
returning None.

Now we use the normal complete() which relies on valid_values if completions
isn't given instead.

Fixes #1223.
2016-01-12 18:53:53 +01:00