Commit Graph

75 Commits

Author SHA1 Message Date
Florian Bruhin
27d4796c2f Add adblock benchmark 2018-11-05 10:05:59 +01:00
Florian Bruhin
3b8964183e Use caplog.messages 2018-10-24 10:57:17 +02:00
Florian Bruhin
fd48e29a54 Add test for per-domain content.host_blocking_enabled 2018-10-06 00:13:58 +02:00
zaowen
5b089d0460 Minor requested changes 2018-09-29 02:00:42 -06:00
Zarthur
b41d7ba203
Merge branch 'master' into master 2018-09-20 11:02:27 -06:00
zaowen
a75587f270 blah 2018-09-20 10:51:33 -06:00
zaowen
5ecfe43ebb ci dumb 2018-09-20 10:49:37 -06:00
zaowen
c4cca4755e Add adblock import directory unit test 2018-09-20 10:38:50 -06:00
Ellis
343de2db51 Added case for whitelisted url with * wildcard 2018-09-18 13:33:05 -04:00
Florian Bruhin
b0185e3c8a Use config_stub.val instead of config_stub.set_obj in tests 2018-09-02 14:42:47 +02:00
Florian Bruhin
1815070dab Make sure the host blocker doesn't block 0.0.0.0 2018-08-31 16:48:45 +02:00
George Edward Bulmer
2789bec1e7 Modify assert_url to treat localhost differently 2018-03-28 14:27:17 +01:00
George Edward Bulmer
a85ac1725f Missing fullstop in a docstring 2018-03-24 22:56:47 +00:00
George Edward Bulmer
eb5684e5f7 Pylint fix 2018-03-24 21:52:26 +00:00
George Edward Bulmer
b9bcad9c14 Grammar change 2018-03-24 21:13:22 +00:00
George Edward Bulmer
64b01cc076 Remove extraneous part 2018-03-24 21:10:23 +00:00
George Edward Bulmer
1380fef600 Add test for parsing multiple lines 2018-03-24 21:08:55 +00:00
George Edward Bulmer
3f37fcf8fa Modify tests, localhost should never be blocked 2018-03-24 20:15:34 +00:00
Jimmy
7dab8335e2 Greasemonkey: handle downloads that complete fast
When `@require`ing local files (with the `file://` scheme) the
greasemonkey manager was not catching the DownloadItem.finished signal
because it was being emitted before it had managed to connect.

I didn't see this happening while testing with files that should have
been in cache but I wouldn't be surprised.

I had to change the download mock to be able to give it the appearance
of asynchronicity. Now when using it one must set download.successful
appropriately before firing download.finished. I also added a list of
downloads to the stub so a test could enumerate them in case the
unit-under-test didn't have a reference to them.
2018-03-03 15:02:43 +13:00
Jimmy
fa1ac8d93c Move download_stub to helpers/fixtures
I am adding support for downloading dependant assets in
browser/greasemonkey and want to mock the download manager for testing.
2018-03-03 15:02:42 +13:00
Jimmy
cba93954cd Allow download_stub test fixture to handle file targets. 2018-03-03 13:14:49 +13:00
Florian Bruhin
c112290664 Make QtNetwork download manager great^H^H^H^Hlobal again
We originally made it per-window in b502280c06 for
issue #228, but that was back when we still needed window IDs for stuff like
message.info.

Nowadays, there's no reason for it to be per-window anymore. The rest of the
download code can deal with one global download manager (because QtWebEngine has
one), and apart from QNAM code which wasn't used here anyways (as tab_id=None)
there was nothing using the window ID anymore.

Also see #3456 which was the original motivation for this change.
2018-02-11 16:15:29 +01:00
Florian Bruhin
fa4ea912c9 Get rid of init_standarddir fixture
Instead, always patch in tmpdir's so we don't write to qute_test folders.
2017-09-15 14:30:46 +02:00
Florian Bruhin
56bbd73622 Introduce standarddir caching
This makes things a bit more complicated, but is needed to make standarddir (and
thus the config) work without a QApplication.
2017-09-13 17:26:56 +02:00
Florian Bruhin
a91e6c3405 Fix test_adblock on Windows
We can't simply have an absolute filename as URL path there, so we only deal
with paths relative to tmpdir in the URLs now.
2017-07-10 22:22:44 +02:00
Florian Bruhin
0cdd3ff82f Update some more references to old config options 2017-07-04 16:46:02 +02:00
Florian Bruhin
cff61fa0bc Fix pylint
This also reverts commit 8df0b063be.
2017-07-04 15:34:10 +02:00
Florian Bruhin
ff05560047 Update test_adblock for new config
This required some changes on how URLs are handled during those tests. Before,
we simply could return a path and (since we had a patched QNAM), nobody
complained.

Now this actually needs to be a valid URL, so we use
https://www.example.com/path everywhere instead.
2017-07-04 15:08:04 +02:00
Florian Bruhin
ecec836111 Fix adblock UTF-8 test on Windows 2017-03-13 07:01:13 +01:00
Florian Bruhin
ace4006179 Stringify py.path.local in adblock tests 2017-03-07 20:36:50 +01:00
Florian Bruhin
c45019f0a0 Handle invalid UTF8 data in hostblock lists
Fixes #2301
2017-03-07 20:25:13 +01:00
Florian Bruhin
81d67f8a2c Remove support for an empty data/config/cachedir
See #2115
2016-11-14 23:13:21 +01:00
Florian Bruhin
6eef79e180 Adjust imports/objreg 2016-11-04 18:49:24 +01:00
Florian Bruhin
fce9783570 Fix unit tests
Apart from changed parameters, messages now log even when messagemock is
used, so we needed to add a few caplog.at_level calls.
2016-09-15 14:51:22 +02:00
Florian Bruhin
a2254b671c Adjust tests/messagemock 2016-09-15 14:51:21 +02:00
Florian Bruhin
d299fd260c Fix adblock tests 2016-09-07 18:53:11 +02:00
Florian Bruhin
f3d540b375 Fix adblock tests 2016-09-07 18:47:39 +02:00
Florian Bruhin
df3733af54 tests: Use pytest.fixture instead of yield_fixture
See #1877
2016-08-22 07:40:24 +02:00
Florian Bruhin
f4f6a3dac1 Merge branch 'open-download' of https://github.com/Kingdread/qutebrowser into Kingdread-open-download 2016-07-26 10:32:34 +02:00
Ryan Roden-Corrent
a6695ea1be Prevent test_adblock from creating real config dir.
Don't create ~/.config/qute_test by mocking out standdarddir.config for
all tests in this module.

This adds config_tmpdir to fixtures.py and moves temp_datadir from
test_adblock to fixtures.py as it will be needed more broadly.
2016-07-15 13:46:50 -04:00
Daniel Schadt
05c09a1476 tests: fix test_adblock for new download manager 2016-07-12 17:06:40 +02:00
Florian Bruhin
2136d00aa2 tests: Add a fake_args fixture 2016-07-10 17:04:25 +02:00
Florian Bruhin
4fccc89d7d Split browser into browser/browser.webkit 2016-06-13 11:18:21 +02:00
Florian Bruhin
afcb018ee2 Fix some spelling mistakes
Found via http://jwilk.net/software/mwic
2016-05-27 12:07:00 +02:00
Florian Bruhin
f306ca9b53 Fix lint 2016-05-08 11:14:42 +02:00
Florian Bruhin
b4272975f2 Revert "Use lists instead of tuples"
This reverts commit eb5bfc1659.
2016-05-08 11:09:47 +02:00
Florian Bruhin
4403f02ac5 Fix HostBlocker.on_config_changed with no datadir 2016-05-07 23:35:30 +02:00
Florian Bruhin
6d1764e732 Clear blocked hosts on start correctly 2016-05-07 23:31:35 +02:00
Florian Bruhin
f6544786c1 dict 2016-05-07 22:41:22 +02:00
Florian Bruhin
2d8bde62a5 docstring 2016-05-07 22:39:53 +02:00