Commit Graph

580 Commits

Author SHA1 Message Date
Michal Siedlaczek
c2197102a3 Enable spell checking and installing dictionaries for QtWebEngine 2017-09-21 09:51:52 -04:00
Florian Bruhin
53b1ffe953 Merge remote-tracking branch 'origin/pr/2965' 2017-09-21 09:12:56 +02:00
Ryan Roden-Corrent
5cd00f699e Resolve KeyError when deleting URL with space.
Resolves #2963.
2017-09-20 07:15:59 -04:00
Florian Bruhin
ef1c83862b Use utils.is_* for platform checks everywhere 2017-09-20 11:10:24 +02:00
Florian Bruhin
3a5241b642 Start using attrs
Closes #1073
2017-09-19 22:21:45 +02:00
Florian Bruhin
7226750363 Bump up Hypothesis deadline globally 2017-09-19 15:08:56 +02:00
Florian Bruhin
bb073e1709 Bump up another hypothesis deadline 2017-09-19 13:38:44 +02:00
Florian Bruhin
a23492fe27 Bump up hypothesis deadline for Content-Disposition test 2017-09-19 11:16:03 +02:00
Florian Bruhin
51afe14965 Set backend to QtWebKit in cookie tests 2017-09-19 11:07:11 +02:00
Florian Bruhin
852baaa8c3 Drop support for Qt < 5.7.1
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
62b30af12a Fix unit tests for end2end SQL change 2017-09-17 11:49:42 +02:00
Florian Bruhin
2e8419db27 Fix lint 2017-09-15 17:24:39 +02: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
54dfc083f9 Remove default_config fixture 2017-09-15 14:13:27 +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
a283a1bb65 Merge branch 'master' into new-config 2017-09-09 10:52:02 +02:00
Ryan Roden-Corrent
b89caf0458 Use REPLACE when rebuilding completion table.
When upgrading from an old table that used different url formatting, two
entries might map to the same key, so we'll need to replace the previous
entry to avoid a primary key conflict.
2017-08-23 21:26:27 -04:00
Ryan Roden-Corrent
d35b47c9d8 Regenerate history completion on version change.
Incrementing _USER_VERSION in the source will cause the
HistoryCompletion table to regenerate when users update.

This is currently necessary to support some recent formatting fixes, but
could be incremented again in the future for other changes.
2017-08-21 08:45:40 -04:00
Ryan Roden-Corrent
5f45b9b40e Fix pylint and coverage for history. 2017-08-20 20:59:48 -04:00
Ryan Roden-Corrent
8c6133e29d Regenerate history completion table if needed.
If the HistoryCompletion table is removed, regenerate it from the
History table. This allows users to manually edit History, then remove
HistoryCompletion to prompt regeneration.

See #2903.
2017-08-18 07:39:36 -04:00
Ryan Roden-Corrent
c607537319 Consistently format urls in history.
Encode urls that are inserted into the history, but do not encode urls
for completion (other than removing passwords).
Also ensure that urls read from the history text file are formatted
consistenly with those added while browsing.

Fixes #2903.
2017-08-14 21:37:43 -04:00
Ryan Roden-Corrent
71b71dbc58 Merge remote-tracking branch 'upstream/master' into HEAD 2017-08-06 18:13:49 -04:00
Florian Bruhin
49b858e359 Add more variants of fake apple URL to ignored ones 2017-08-01 16:00:53 +02:00
Florian Bruhin
fba25338be Merge pull request #2295 from rcorre/really_complete
Completion refactor V3
2017-07-21 15:05:43 +02:00
Ryan Roden-Corrent
8745f80d90 Fix qute://history SQL bug.
The javascript history page was requesting the new start_time in ms, but
the python code was expecting seconds. This is fixed by removing all the
millisecond translations in the python code and only translating to
milliseconds in the javascript code that formats dates.
2017-07-13 08:54:21 -04:00
Ryan Roden-Corrent
1aed2470e5 SQL code review.
- Fix flake8
- history.clear should also clear completion table
- call _resize_columns in set_model, not set_pattern
- add more unit-testing for the history completion table
2017-07-12 22:14:27 -04:00
Ryan Roden-Corrent
ea459a1eca SQL code review fixes.
- Ignore invalid variable name in flake8 (pylint already checks this and
  we don't want to have to double-ignore)
- Fix and test completion bug with `:set asdf `
- Remove unused import
- Use `assert not func.called` instead of `func.assert_not_called` for
  backwards compatibility
2017-07-12 08:19:31 -04: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
Ryan Roden-Corrent
cf4ac1a5b7 SQL code review changes.
- use mocker.Mock instead of mock.Mock to avoid an extra import
- attach model to validator sooner so it can validate changes in the
  model during the test
2017-07-08 16:34:38 -04:00
Iordanis Grigoriou
c9fd182dba Adjust suggested_fn_from_title, add tests 2017-07-08 16:28:58 +02:00
Ryan Roden-Corrent
f9f8900fe9 More sql code review fixes.
- remove outdated comment
- fix sql init error message
- clean up history text import code
- fix test_history file path in coverage check
- use real web history, not stub, for completion model tests
- use qtmodeltester in sql/list_category tests
- test url encoding in history tests
- fix test_clear by using a callable mock
- remove test_debug_dump_history_oserror as the check is now the same as
  for the file not existing
- rename nonempty to data in test_completionmodel
- add more delete_cur_item tests
- test empty option/value completion
2017-07-08 09:57:32 -04:00
Iordanis Grigoriou
82d194cf2e Improve function docstring, add more tests 2017-07-06 21:37:11 +02:00
Iordanis Grigoriou
3bfafb5e50 Refactor suggested_fn_from_title, add unit tests 2017-07-06 17:41:54 +02:00
Ryan Roden-Corrent
dc4472470e Merge remote-tracking branch 'upstream/master' into really_complete 2017-07-05 08:45:57 -04: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
9db4a8cb43 Clean up test_cache 2017-07-04 15:08:04 +02:00
Florian Bruhin
22b0f2fd24 Various simple test updates for new config
test_cache
test_cookies
test_webkitelem
test_cmdutils
test_runners
test_completionwidget
test_messageview
test_editor
test_miscwidgets
test_sessions
test_urlutils
test_utils
test_prompt
statusbar/test_*
test_cmdhistory
test_tabwidget
test_tab
test_downloads
test_networkmanager
2017-07-04 15:08:04 +02:00
Florian Bruhin
1663280f53 Update test_shared for new config
Also, make accept_language none_ok=True like it was in the old configdata.py
2017-07-04 15:08:04 +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
556f49d367 Add PACFetcher.fetch
Let's not try to download proxies during tests...
2017-07-04 15:08:04 +02:00
Ryan Roden-Corrent
1e1335aa5e Make various SQL code review changes.
- Fix outdated comments
- Use mock specs when possible
- More precise error message check in test_import_txt_invalid.
- Fix copyright message
- Tweak missing pyqt error message
- Dead code: remove group_by and where from sqlcategory.
  With the new separate completion table, these are no longer used.
- Move test_history out of webkit/. History is no longer purely webkit
  related, it could be webengine.
2017-07-03 09:45:08 -04:00
Ryan Roden-Corrent
6ac940fa32 Fix pylint/coverage errors.
Ensure 100% coverage for sqlcategory and history, and fix some linter
errors
2017-06-27 12:33:51 -04:00
Ryan Roden-Corrent
866f4653c7 Fix spelling existant -> existent. 2017-06-25 22:14:38 -04:00
Ryan Roden-Corrent
0f585eda4f Bring history.py back to 100% coverage.
The code of debug_dump_history was tweaked to handle a possible
OSException that can be thrown by open, which I noticed while trying to
test it.
2017-06-20 21:41:43 -04:00
Florian Bruhin
cb5cd1a910 Remove old test_commands.py 2017-06-20 15:20:32 +02:00
Florian Bruhin
994e8c692f Merge different FakeTabbedBrowser objects 2017-06-20 15:19:53 +02:00
Ryan Roden-Corrent
4e87773d89 Use a dict instead of named params for insert.
This allows replace to be a named parameter and allows consolidating
some duplicate code between various insert methods.

This also fixes some tests that broke because batch insert was broken.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f4f52ee204 Remove history.Entry.
No longer needed with sql backend. Query results build their own
namedtuple from the returned columns, and inserting new entries is just
done with named parameters.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
1fe1813431 Fix pylint errors. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
fa39b82b3c Backup old history file after import.
Instead of removing it, move it to history.bak.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a6a9ad72f9 Fix test_history_interface.
This was still using a history dict instead of SQL history.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3a4ef09f58 More sql code review fixes 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6fc61d12fc Assorted small fixes for sql code review. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
309b6ba32c Move _import_history to history.py.
Also adjusts the history import test to operate at a higher level and
ensure the old text file is removed (or isn't, in the case of an error).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
20000088de Add debug-dump-history and fix sql history tests.
Trying to read from the sql database from another process was flaky.
This adds a debug-dump-history command which is used by the history BDD
tests to validate the history contents.

It outputs history in the old pre-SQL text format, so it might be
useful for those who want to manipulate their history as text.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
87643040a4 Fix test_history for python < 3.6.
Mock.assert_called is only in python 3.6. For earlier versions we must
use `assert m.called`.

Weird errors only appearing in CI, trying to debug...
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
eb61269068 Fix qute://history javascript for SQL.
Returning "next" was no longer possible as the SQL query does not fetch
more items than necessary. This is solved by using a start time, a
limit, and an offset. The offset is needed to prevent fetching duplicate
items if multiple entries have the same timestamp.

Two of the history tests that relied on qute://history were changed to
rely on qute://history/data instead to make them less failure-prone.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
9d4888a772 Optimize qute://history for SQL backend.
The old implementation was looping through the whole history list, which for
SQL was selecting every row in the database. The history benchmark was taking
~2s. If this is rewritten as a specialized SQL query, the benchmark takes
~10ms, an order of magnitude faster than the original non-SQL implementation.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
44080b8ad4 Fix flake8 errors in test_history 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e661fb7446 Fix test_history.
History doesn't depend on standarddir anymore, the history file path get passed
by app.py.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f110cf4d53 Fix long hang after importing history.
Turns out historyContains was getting called for the webkit backend multiple
times when the browser starts. This was calling `url in history`, which was
enumerating the entire history as `__contains__` was not defined.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
024386d189 Fail on history file parsing errors.
Instead of skipping bad history lines during the import to sql, fail hard. We
don't want to delete the user's old history file if we couldn't parse all of
the lines.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6412c88277 Clean up history module.
Eliminate out-of-date docstring and remove an unused signal.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3e63b62d6e Fix pylint/flake8 for sql work. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8ff45331df Clean up sql implementation.
Now that sql is only used for history (not quickmarks/bookmarks) a number of
functions are no longer needed. In addition, primary key support was removed as
we actually need to support multiple entries for the same url with different
access times. The completion model will have to handle this by selecting
something like (url, title, max(atime)).

This also fixes up a number of tests that were broken with the last few
sql-related commits.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
80647b062a Convert old history file to sqlite.
If qutebrowser detects a history text file when it starts
(~/.local/share/qutebrowser/history by default on Linux), it will import this
file into the new sqlite database, then delete it.

The read is done as a coroutine as it can take some time.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
de5be0dc5a Store history in an on-disk sqlite database.
Instead of reading sqlite history from a file and storing it in an in-memory
database, just directly use an on-disk database. This resolves #755, where
history entries don't pop in to the completion menu immediately as they are
still being read asynchronously for a few seconds after the browser starts.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
4296eed429 Fix test_history cleanup failure.
The test may be skipped if the PyQt5.QtWebKitWidget import fails, but the
cleanup was still running and trying to delete a nonexistant web-history.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
56f3b3a027 Small review fixups for SQL implementation.
Respond to the low-hanging code review fruit:

- Clean up some comments
- Remove an acidentally added duplicate init_autosave
- Combine two test_history tests
- Move test_init cleanup into a fixture to ensure it gets called.
- Name the _ argument of bind(_) to _key
- Ensure index is valid for first_item/last_item
- Move SqlException to top of module
- Rename test_index to test_getitem
- Return QItemFlags.None instead of None
- Fix copyright dates (its 2017 now!)
- Use * to force some args to be keyword-only
- Make some returns explicit
- Add sql to LOGGER_NAMES
- Add a comment to explain the sql escape statement
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
fc5fd6096a Revert "Initialize SQL for two failing tests."
This reverts commit 386e227ce7534f1e427db7ba6d4e53dc153a49f3.
The problem was really state leakage, initializing sql for these tests isn't
necessary.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
788babbb61 Further prevent state leakage from test_init.
test_history.test_init also leaked state by leaving the instantiated history as
the parent of the QApp, which was causing test_debug to fail because it was
trying to dump the history object left from test_history.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
d658378af3 Eliminate test interference from webkit history.
Initializing the qtwebkit history backend left some global state that was
leaking into other tests.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
490250f5be Initialize SQL for two failing tests.
test_selectors and test_get_all_objects were running fine on my machine, but
for some reason is failing with "Driver not loaded" on Travis. Let's try
initializing SQL and see what happens.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
ea9217a61f Fix qutescheme for new SQL backend.
The qute://history and qute://bookmarks handlers were added during my work, and
had to be adapted to the SQL-based history backend.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
839d49a8ac Fix up pylint/flake8 for completion revamp. 2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
a774647c26 Get test_models mostly working again.
- Adjust _check_completions to work for CompletionModel and SqlCompletionModel
- Move sql initialization into a reusable fixture
- Remove the bookmark/quickmark/history stubs, as they're now handled by sql
- Disable quickmark/bookmark model tests until their completion is ported to
  sql.
- Disable urlmodel tests for features that have to be implemented in SQL:
    - LIMIT (for history-max-items)
    - Configurable column order (for quickmarks)
    - Configurable formatting (for timestamp-format
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
acea0d3c67 Use SQL completion for the open command.
Now that history, bookmark, and quickmark storage are SQL-backed, use
a sql completion model to serve url completions.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
9477a2eeb2 Use SQL for history storage.
The browser-wide in-memory web history is now stored in an in-memory sql
database instead of a python dict. Long-term storage is not affected, it
is still persisted in a text file of the same format.

This will set the stage for SQL-based history completion.
See #1765.
2017-06-19 07:42:12 -04:00
Florian Bruhin
ea2fbc427a tests: Use match= for pytest.raises 2017-05-23 09:36:00 +02:00
Florian Bruhin
af7923de4d tests: Use pytest.param 2017-05-23 08:08:46 +02:00
Florian Bruhin
f66c1a0e44 Merge commit '3d9729839d6d9b5ee5d38afdf6ddf410dfca2027' into abbradar/pac-fix 2017-05-19 08:36:39 +02:00
Florian Bruhin
c4fb2bc609 Fix URL/renderer crash tests with Qt 5.9
The behavior in Qt changed there (in a good way), so we need to adjust the tests
accordingly.

Fixes #2514
2017-05-19 08:10:17 +02:00
Nikolay Amiantov
3d9729839d Fix crash on PAC evaluation error 2017-05-18 16:54:49 +03:00
Florian Bruhin
00a7a0cee6 Reorganize pylint config
This removes various stuff we don't need anymoe, and also re-enables and fixes
the import order check.
2017-05-17 20:20:12 +02:00
Florian Bruhin
12520bf4ba Install PyQt from PyPI for pylint
This means we can be sure to have QtWebEngine available and won't have QtWebKit.
2017-05-17 19:08:59 +02:00
Florian Bruhin
9408babef5 Also remove test for removed assertion 2017-05-16 12:56:25 +02:00
Florian Bruhin
086139110d Merge branch 'new-private-browsing' 2017-05-16 06:32:15 +02:00
Florian Bruhin
65952ca290 Fix webkitelem tests 2017-05-12 13:57:33 +02:00
Florian Bruhin
9e2aa65c02 Remove webelem.Group.prevnext
Apart from checking for buttons with an href attribute (which made no sense at
all and should never return any element) this was identical to
webelem.Group.links.
2017-05-12 09:41:12 +02:00
Florian Bruhin
203a5dff74 Get rid of webelem.FILTERS
There's actually no good reason to filter javascript links as we might want to
click them (or copy their URL) just like any other link - this fixes #2404.

With that being gone, we don't need FILTERS at all anymore, as we can check for
existence of the href attribute in the CSS selector instead.
2017-05-12 09:41:12 +02:00
Florian Bruhin
c6e31391de Fix most tests/lint 2017-05-10 09:19:24 +02:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin
11c026bf4c Reenable QtWebKit cache with Qt 5.9.
This was fixed here:
https://codereview.qt-project.org/#/c/190818/

See #2427
2017-04-24 12:27:00 +02:00
Ryan Roden-Corrent
6151b43c47 Fix qute_history benchmark.
This benchmark was running very quickly due to an improper setup.
The current history implementation expects that a newly inserted entry must
be more recent than any existing entries and sorts according to this
assumption.

The benchmark test inserts increasingly older entries, breaking this invariant.
When run in the benchmark, the qute://history/data implementation would
see an entry older than the oldest time in the time window and would
immediately return with a single "next" entry.

This patch inserts data in an order that mantains history's invariant and adds
a sanity-check at the end of the test. It does not check for the exact length
as not all entries will be within the time window. The length will be some
values <= 100000, the check just ensures that there is at least something more
than a "next" entry.

Before:
---------------------------------------------- benchmark: 1 tests ----------------------------------------------
Name (time in us)                  Min      Max    Mean  StdDev  Median     IQR  Outliers(*)  Rounds  Iterations
----------------------------------------------------------------------------------------------------------------
test_qute_history_benchmark     9.3050  21.9250  9.6143  0.2454  9.5880  0.1070      230;360    9930           1
----------------------------------------------------------------------------------------------------------------

After:
-------------------------------------------------- benchmark: 1 tests -------------------------------------------------
Name (time in ms)                    Min       Max      Mean  StdDev    Median     IQR  Outliers(*)  Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------
test_qute_history_benchmark     220.7040  223.1900  221.7536  1.1070  221.1939  1.8803          1;0       5           1
-----------------------------------------------------------------------------------------------------------------------
2017-04-17 12:15:49 -04:00
Florian Bruhin
db8b6d3e68 Add test for QNetworkReply.abort 2017-04-17 16:02:57 +02:00
Florian Bruhin
a081d4184d tests: Adjust percent-encoding tests for Qt 5.9 changes
See #2514
2017-04-08 19:25:55 +02:00
Florian Bruhin
4ec5700cbf Redirect qute:foo to qute://foo
Before, we just returned the same data for both, but then we'll run into
same-origin restrictions as qute:history and qute:history/data are not the same
host.
2017-04-06 21:18:58 +02:00
Florian Bruhin
0de3b5460e Only disable the cache on Qt 5.7.1
I ended up bisecting it, and https://codereview.qt-project.org/#/c/153977/
causes this, which is not in 5.7.0.
2017-04-04 08:24:50 +02:00
Florian Bruhin
2eb365b146 Also disable cache on Qt 5.7 2017-04-03 20:22:54 +02:00
Florian Bruhin
b6642e66fa Fix cache tests on Qt 5.8 2017-04-03 19:41:37 +02:00
Florian Bruhin
7652b6ae03 Merge commit '724e6b29c38a55f722f17997379f1ebe190fa6db' 2017-03-20 09:11:47 +01:00
Imran Sobir
fb97c6dffc Send history item atime in milliseconds. 2017-03-16 12:03:40 +05:00
Florian Bruhin
ecec836111 Fix adblock UTF-8 test on Windows 2017-03-13 07:01:13 +01:00
Imran Sobir
a1bec12b2e Ensure qute:javascript throws QuteSchemeOSError on 404. 2017-03-09 22:07:55 +05:00
Imran Sobir
50bca33618 Use OSError instead of IOError. 2017-03-09 21:47:12 +05: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
Imran Sobir
907d94591d Make a now fixture to hold time of test. 2017-03-02 23:55:59 +05:00
Imran Sobir
895620b536 Don't assume 'next' appears last. 2017-03-02 22:40:24 +05:00
Florian Bruhin
65f407e926 Remove webelem.style_property()
It's not used anymore, and not possible to support with QtWebEngine without a
massive performance hit when serializing elements.
2017-03-01 17:54:27 +01:00
Florian Bruhin
deb59fc66e Don't strip info when loading PAC from a file 2017-03-01 14:19:23 +01:00
Florian Bruhin
9bb5c9fdab Remove UserInfo and path/query for PAC URLs 2017-03-01 14:19:13 +01:00
Florian Bruhin
ca4f249c30 Use three-argument form of monkeypatch.*attr 2017-03-01 11:33:41 +01:00
Imran Sobir
cb6c6b814e Fix pylint errors. 2017-02-28 20:11:51 +05:00
Imran Sobir
3b3846c9dc Add qute:javascript to serve JS files. 2017-02-27 22:37:24 +05:00
Imran Sobir
783769d302 Load new history items from next item's time. 2017-02-27 21:44:23 +05:00
Imran Sobir
c223f6c69d Style/misc fixes. 2017-02-27 21:39:51 +05:00
Imran Sobir
845f21b275 New qute:history page. 2017-02-26 17:07:30 +05:00
Florian Bruhin
9656449545 Merge branch 'master' of https://github.com/kiryl/qutebrowser into kiryl-master 2017-02-25 17:53:05 +01:00
Florian Bruhin
3cc32e0b6a Fix lint 2017-02-25 17:24:27 +01:00
Florian Bruhin
02c913238b Fix test_webkitelem 2017-02-24 13:51:45 +01:00
Kirill A. Shutemov
13213724b0 PAC: fix isPlainHostName()
Fix isPlainHostName() implementation and add test-case for it.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2017-02-21 12:16:46 +03:00
Florian Bruhin
c3153273f5 Merge branch 'master' of https://github.com/imransobir/qutebrowser into imransobir-master 2017-02-11 17:05:57 +01:00
Florian Bruhin
f063d4be6f Add a benchmark for qute:history 2017-02-10 11:39:07 +05:00
Florian Bruhin
46c02bf5ae Refactor qute:history unittests 2017-02-10 11:39:07 +05:00
Imran Sobir
100f90d9b3 Fix pylint errors. 2017-02-09 18:28:10 +05:00
Florian Bruhin
97982df1cb Adjust history unittest 2017-02-09 13:40:44 +01:00
Imran Sobir
a15aa9eade Hide next links to future. 2017-02-09 17:18:57 +05:00
Imran Sobir
920fb81377 Use pytest's tmpdir fixture. 2017-02-09 16:39:21 +05:00
Imran Sobir
49271b7ce1 Generate and cleanup fake web-history in own fixture. 2017-02-09 16:32:59 +05:00
Imran Sobir
4eccfd5396 Style fixes. 2017-02-09 15:51:00 +05:00
Imran Sobir
828b0c00b5 Rename test_qutehistory.py to test_qutescheme.py. 2017-02-09 15:39:50 +05:00
Florian Bruhin
601110761d Fix test_history.test_init without QtWebKIt 2017-02-09 00:50:38 +01:00
Florian Bruhin
8779a1367e Fix test collection without QtWebKit 2017-02-09 00:50:37 +01:00
Imran Sobir
0ab7fd4581 Restore original save-manager, web-history at end of test. 2017-02-08 16:18:33 +05:00
Imran Sobir
ec0e95969e Add unit tests for qute://history. 2017-02-08 13:28:04 +05:00
Florian Bruhin
98e6ccf548 Add fullscreen support for QtWebEngine 2017-02-06 16:22:58 +01:00
Florian Bruhin
b1a95a3930 Add automatic backend selection in earlyinit 2017-02-05 17:09:04 +01:00
Florian Bruhin
de50f30b9b Replace all GitHub links 2017-02-05 00:13:11 +01:00
Florian Bruhin
b6e31d4172 Fix parametrizing 2017-02-04 19:03:59 +01:00
Florian Bruhin
0cc7f845e6 Simplify test 2017-02-04 18:10:34 +01:00
Florian Bruhin
4c14b2983b Merge branch 'more-pac' of https://github.com/abbradar/qutebrowser into abbradar-more-pac 2017-02-04 18:07:45 +01:00
Florian Bruhin
428e495935 Unconditionally disable test_tab
This now also causes segfaults with Qt 5.8, so something is definitely wrong
here...

See #1638 and #2261
2017-02-01 11:09:08 +01:00
Florian Bruhin
cc4a8e53df Prevent using %2F as slash in a Content-Disposition header 2017-01-13 18:04:04 +01:00
Nikolay Amiantov
aec002fa29 Add more tests for PAC 2017-01-03 13:47:13 +03:00
Florian Bruhin
6c1b7dcca1 Move proxy/pac out of QtWebKit folder 2016-12-22 13:54:11 +01:00
Florian Bruhin
a3d0ea7e01 Adjust skipped test 2016-12-22 09:04:23 +01:00
Florian Bruhin
5a89ee96d9 Merge branch 'pac' of https://github.com/abbradar/qutebrowser into abbradar-pac 2016-12-22 08:53:10 +01:00
Florian Bruhin
5746337733 Fix downloads without QtWebEngine 2016-12-09 07:29:51 +01:00
Florian Bruhin
d0372f1730 Decode percent sequences in QtWebEngine downloads
Fixes #2122.
2016-12-09 07:08:51 +01:00
Florian Bruhin
03eea7f62a Remove download filename suffixes with QtWebEngine 2016-12-09 07:00:25 +01:00
Nikolay Amiantov
27d64d3680 Add tests for PAC resolver and fetcher 2016-12-07 02:01:19 +03:00
Florian Bruhin
1536a3324e Fix lint 2016-12-06 23:09:23 +01:00
Florian Bruhin
e39d6996c6 Fix test_tab 2016-12-06 22:50:25 +01:00
Maciej Wołczyk
f6802272c7 Added a test for quopri with spaces at the end of the line 2016-12-01 01:17:00 +01:00
Maciej Wołczyk
2cbea50152 Fixed style issues, corrected unit test 2016-11-29 19:10:36 +01:00
Florian Bruhin
52df867030 Fix test_webkitelem 2016-11-16 13:09:16 +01:00
Florian Bruhin
964ddb472b Add urlutils.data_url 2016-11-15 22:25:51 +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
cf32aac111 Move usertypes.DownloadTarget to downloads module 2016-11-09 08:15:58 +01:00
Florian Bruhin
6eef79e180 Adjust imports/objreg 2016-11-04 18:49:24 +01:00
Florian Bruhin
ece3f3a2e1 Update to pytest-qt 2.1.0 2016-10-26 07:42:41 +02:00
Daniel Schadt
a9ac123bfa tests: relax pdfjs tests
Updating the whole snippet in two places is bad, so we relax the testing
code.
2016-10-06 16:18:21 +02:00
Florian Bruhin
dd537c9119 Really fix test_mthml 2016-10-05 10:12:38 +02:00
Florian Bruhin
8dab1cf58a Fix test_mhtml.py 2016-10-05 09:09:42 +02: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
5bef7dc74c Use file with known mimetype for qutescheme test 2016-09-14 16:48:49 +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
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
b949e4d73a Start splitting DownloadModel from DownloadManager
This mostly works, apart from remove_item/remove_items not being
available on the model.
2016-09-11 14:58:07 +02:00
Florian Bruhin
4c55963dc3 Fix lint 2016-09-10 17:32:04 +02:00
Florian Bruhin
0ba74ad023 Add Qt model test for download model 2016-09-10 16:42:26 +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
44d1056e54 QtWebEngine: Implement custom HTTP headers 2016-09-07 18:29:38 +02:00
Florian Bruhin
3e1583bb1c Make WebKitElement._is_visible private
It makes a lot of sense for this to be in webkitelem.py, but it should
not be public API as it's only used internally and can't be implemented
here with QtWebEngine.
2016-09-07 11:58:39 +02:00
Florian Bruhin
60c86a08c4 Get rid of WebElement.debug_text 2016-09-07 11:47:39 +02:00
Florian Bruhin
e700d11447 Add check_vanished() in webkitelem.insert_text 2016-09-07 11:29:26 +02:00
Florian Bruhin
8f9cfcf232 Get rid of webelem.run_js_async 2016-09-07 11:27:37 +02:00
Florian Bruhin
78d64f4791 Get rid of webkitelem.focus_elem 2016-09-07 11:24:28 +02:00
Florian Bruhin
ee5a972069 Move auto-insert-mode handling to browsertab
This means auto-insert-mode now works correctly with QtWebEngine.
2016-09-07 10:24:27 +02:00
Florian Bruhin
f6ba859896 Move tabhistory.TabHistoryItem to misc.sessions
This makes browser.webkit.tabhistory contain only QtWebKit-specific
code.
2016-09-06 09:50:55 +02:00
Florian Bruhin
cf44019475 Don't require QtWebEngine for history tests 2016-09-05 22:25:20 +02:00
Florian Bruhin
7592345b6e Make unittests work without QtWebKit 2016-09-05 18:45:50 +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
4c2b64b573 tests: Clean up test_http 2016-08-20 22:07:12 +02:00
Florian Bruhin
5113fa8515 Fix test_tab 2016-08-18 14:36:56 +02:00
Florian Bruhin
63c66945a4 Add webelem.click() and webelem.hover() 2016-08-18 14:32:19 +02:00
Florian Bruhin
a0add7b66c Get rid of tab.run_js_blocking
We had some trouble with it, and it's not actually needed.
2016-08-18 14:02:59 +02:00
Florian Bruhin
6f24221c54 Replace WebElement.frame() by .has_frame() 2016-08-18 12:40:21 +02:00
Florian Bruhin
62db0095d1 Revert "Make webelem.rect_on_view work async"
This reverts commit 4e11613d2df064b138532c18f88bbf278c64f347.

We can actually make this synchronous just fine by collecting that
information when searching for the elements...
2016-08-18 12:40:21 +02:00
Florian Bruhin
e6d6302958 Make webelem.rect_on_view work async
WebKitElement still has an internal sync version used for is_visible,
but hopefully we can get rid of that soon too.
2016-08-18 12:40:21 +02:00
Florian Bruhin
359d4dd427 tests: Add a callback_checker fixture 2016-08-18 12:40:21 +02:00
Florian Bruhin
8cd822c7db Add blank lines 2016-08-17 14:51:05 +02:00
Florian Bruhin
0293307d61 Remove adjust_zoom for webelem.rect_on_view
Previously, the drawn hint labels were affected by the zoom, i.e., they
were stretched out by QtWebKit and actually had to be drawn at the
unzoomed position.

The Python/C++ API gives us coordinated adjusted for zoom, so
we always *negatively* adjusted them to get the unzoomed coordinates.

JS gave us the original coordinates, so we stretched them out according
to the zoom if adjust_zoom was given (which means only when clicking a
link).

Now we always operate in term of display coordinates: The point where we
draw the hint label is equal to the point we're clicking.

Thus, the zoom level for javascript is always adjusted, and the Python
zoom level is never (negatively) adjusted.
2016-08-17 14:51:05 +02:00
Florian Bruhin
cf7170a33b Remove no longer needed webelem methods
The following methods were only used for hint labels and thus removed
now:

- document_element
- create_inside
- find_first
- set_inner_xml
- remove_from_document
- set_style_property
2016-08-17 14:44:49 +02:00