Commit Graph

1010 Commits

Author SHA1 Message Date
Florian Bruhin
0498e042a0 Ignore another macOS log line 2017-09-13 21:32:22 +02:00
Florian Bruhin
8c4bc76de6 Stabilize hint test which failed on macOS 2017-09-13 17:26:56 +02:00
Florian Bruhin
56b673ca05 tests: Don't use <Ctrl+Backspace> to clear qute://settings fields
This won't work on macOS
2017-09-13 10:29:54 +02:00
Florian Bruhin
9bcd120dcc Only mark completion issue as flaky 2017-09-11 19:33:27 +02:00
Florian Bruhin
f6a0500bd3 Merge branch 'master' into new-config
This pulls the travis changes to drop the old Qt 5.2 environment.
2017-09-11 18:39:41 +02:00
Florian Bruhin
a65d70820a Add macOS xfail for session completion test
See #2956
2017-09-11 18:33:08 +02:00
Florian Bruhin
50d43b0678 Fix some macOS testsuite issues 2017-09-11 18:33:08 +02:00
Florian Bruhin
2538fec0c5 Ignore Mach IPC message 2017-09-11 18:33:08 +02:00
Florian Bruhin
f320da07b4 Increase timeout for test_version 2017-09-11 18:33:07 +02:00
Florian Bruhin
9e10f891ff Print output earlier in test_version 2017-09-11 18:32:23 +02:00
Florian Bruhin
9a8088586f tests: Ignore dbus-uuidgen error messages 2017-09-11 18:32:23 +02:00
Florian Bruhin
1491f20201 Remove geolocation tests
They just cause more trouble than they're worth.
2017-09-11 18:32:23 +02:00
Florian Bruhin
a283a1bb65 Merge branch 'master' into new-config 2017-09-09 10:52:02 +02:00
Ryan Roden-Corrent
a6d14ad7dc Fix two new-config/master merge resolutions.
Remove icon from jinja.render call (removed in master).
Add 'When the unwritable dir is unwritable' to download feature file.
2017-09-07 08:58:55 -04:00
Ryan Roden-Corrent
6a292f9d56 Merge quteurls.feature into qutescheme.feature. 2017-08-28 07:18:14 -04:00
Ryan Roden-Corrent
61a03a7808 Add quteurls.feature
Move Scenario: Open qute://version from misc.feature to quteurls.feature
See #2779.
2017-08-27 22:37:04 -04:00
Ryan Roden-Corrent
722137ab29 Fix 2 end2end tests for config/completion merge. 2017-08-20 21:15:25 -04:00
Ryan Roden-Corrent
0286e9ddf2 Fix completion tests after config merge. 2017-08-20 21:12:38 -04:00
Jay Kamat
7073c33dce
Test for saving a session with --only-active-window 2017-08-17 22:27:40 -04:00
Ryan Roden-Corrent
71b71dbc58 Merge remote-tracking branch 'upstream/master' into HEAD 2017-08-06 18:13:49 -04:00
Florian Bruhin
5ecda25fdb Fix renderer process test for older Qt versions 2017-07-25 17:35:42 +02:00
Florian Bruhin
792a01ba6d Try to stabilize renderer process test 2017-07-25 16:56:38 +02:00
Florian Bruhin
07b2fde2de Mark test_version as flaky
Sometimes it fails on Travis with empty output for no apparent reason
2017-07-24 08:05:51 +02:00
Florian Bruhin
56b4989f44 Fix tests for QProcess changes 2017-07-23 22:10:50 +02:00
Florian Bruhin
fba25338be Merge pull request #2295 from rcorre/really_complete
Completion refactor V3
2017-07-21 15:05:43 +02:00
Florian Bruhin
cbf9da0b7e Set window.navigator.languages correctly 2017-07-13 21:24:17 +02:00
Florian Bruhin
ac8fb03b80 Fix lint 2017-07-10 20:37:30 +02:00
Florian Bruhin
135fb042da Make settings from qute://settings persistent 2017-07-10 18:04:39 +02:00
Florian Bruhin
84c2289aa5 Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-07-09 12:56:52 +02:00
Florian Bruhin
915cd5f016 Fix long lines 2017-07-09 11:51:22 +02:00
Florian Bruhin
ad615941a2 Replace OS X with macOS 2017-07-08 11:12:43 +02:00
Iordanis Grigoriou
3bfafb5e50 Refactor suggested_fn_from_title, add unit tests 2017-07-06 17:41:54 +02:00
Iordanis Grigoriou
57e4d4978b Use page title only for whitelisted extensions 2017-07-06 11:59:02 +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
45b1285402 Merge pull request #2765 from jgkamat/jay/tab-crashes
Refactor set_tab_pinned to take a tab widget.
2017-07-04 17:24:10 +02:00
Florian Bruhin
0cdd3ff82f Update some more references to old config options 2017-07-04 16:46:02 +02:00
Florian Bruhin
770c879410 Bring back searchengine BDD tests 2017-07-04 15:39:07 +02:00
Florian Bruhin
cff61fa0bc Fix pylint
This also reverts commit 8df0b063be.
2017-07-04 15:34:10 +02:00
Florian Bruhin
acf85eb96b Stabilize qute://settings test 2017-07-04 15:09:23 +02:00
Florian Bruhin
a36f5bafc1 Rename content.javascript.can_*_windows to _tabs 2017-07-04 15:08:04 +02:00
Florian Bruhin
5ada3606d8 Allow to not send the DNT header 2017-07-04 15:08:04 +02:00
Florian Bruhin
202b8445f6 Move content.accept_language under headers 2017-07-04 15:08:04 +02:00
Florian Bruhin
8712fc6fd3 Move new_instance_open_target out of url.
It doesn't really fit there really...
See 3cf028db23cbfe256e499d8881c3c2856f224d94
2017-07-04 15:08:04 +02:00
Florian Bruhin
07d0ea6a54 Unit tests and improvements for :bind/:unbind 2017-07-04 15:08:03 +02:00
Florian Bruhin
353c10aee7 Add a separate qutescheme BDD file 2017-07-04 15:08:03 +02:00
Florian Bruhin
3edebce833 Add tests for :set 2017-07-04 15:08:03 +02:00
Florian Bruhin
df1685905e Add content.headers and content.cache groups 2017-07-04 15:08:03 +02:00
Florian Bruhin
50602cbf26 Add an url. group to settings 2017-07-04 15:08:03 +02:00
Florian Bruhin
ac64ea287a Rename tabs.new_position/_explicit to .related/.unrelated 2017-07-04 15:08:03 +02:00
Florian Bruhin
c141c33b32 Clean up start_pages setting
The value is now of type FuzzyUrl, and the setting is renamed to start_pages.
2017-07-04 15:08:03 +02:00
Florian Bruhin
ad919fc972 Add a test for :bind with a wrong mode 2017-07-04 15:08:03 +02:00
Florian Bruhin
23d30d4fc0 Fix remaining :bind/:unbind issues 2017-07-04 15:08:03 +02:00
Florian Bruhin
ba1bc29a97 Initial :bind/:unbind implementation 2017-07-04 15:08:02 +02:00
Florian Bruhin
d9f1c4595e Make "the option ... should be set to ..." unambiguous
Otherwise, it'd collide with the cookie check.
2017-07-04 15:08:02 +02:00
Florian Bruhin
3c2d568a2e Add an ID for qute://settings inputs 2017-07-04 15:08:02 +02:00
Florian Bruhin
ceca99a99c Fix :help with new config 2017-07-04 15:08:02 +02:00
Florian Bruhin
0d062b28bf Comment out failing test 2017-07-04 15:08:02 +02:00
Florian Bruhin
bd9b45bb96 tests: Fix more issues with new config 2017-07-04 15:08:02 +02:00
Florian Bruhin
089e1ee91b Rewrite various references to old settings 2017-07-04 15:08:02 +02:00
Florian Bruhin
88fb5bbd82 tests: Fix various issues with new config 2017-07-04 15:08:02 +02:00
Florian Bruhin
ab1b80967f Disable tests which won't work yet
They are re-enabled in later commits.
2017-07-04 15:08:02 +02:00
Florian Bruhin
f27978e268 Rename input.insert_mode.auto_focused to _load 2017-07-04 15:08:02 +02:00
Florian Bruhin
3470e9bf5d Fix invocation with -s 2017-07-04 15:08:02 +02:00
Florian Bruhin
d0904a9f67 Adjust test settings 2017-07-04 15:08:02 +02:00
Florian Bruhin
0c1f480fc1 Remove TODO for qute://settings on webengine 2017-07-04 15:08:01 +02:00
Florian Bruhin
3b53ec1cb6 Skip tests with permission changes if they didn't work
This e.g. wouldn't work inside of a Docker container otherwise.
2017-07-03 10:07:40 +02:00
Jay Kamat
2fbadc46d2 Remove error when count is invalid to :tab-pin 2017-06-30 09:57:39 -07:00
Jay Kamat
596dee69d6
Clean up pin_tab
Also add a test case for :pin-tab with an invalid count
2017-06-29 20:04:02 -07:00
Florian Bruhin
d132b6ed71 Fix :scroll-page with --bottom-navigate on QtWebEngine
There were two issues here:

- The comparison was backwards, causing scroller.at_bottom() to always return
  true.
- When zoomed in, jsret['px']['y'] can be a float, which means we can be
  slightly off when checking the difference - math.ceil() fixes that.
2017-06-29 22:39:48 +02:00
Iordanis Grigoriou
0a09758be1 Add file path to download 2017-06-27 12:21:25 +02:00
Florian Bruhin
5ec94f96fd Allow a trailing % for :zoom 2017-06-26 21:51:35 +02:00
Iordanis Grigoriou
a24d7f6686 Use page title for filename with :download 2017-06-26 12:25:03 +02:00
Florian Bruhin
06d4a24bd1 Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-06-20 12:45:21 +02:00
Iordanis Grigoriou
f0ff02fcb2 Avoid throwing exception when no last focused tab exists 2017-06-19 15:48:17 +02:00
Florian Bruhin
4296a61b9a tests: Clean up check_history 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c7a18a8b8d Fix tests for recent sql changes 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
cf23f42b99 Use splitlines in test_history_bdd again.
Just using read() returns a single string, and iterating over that
iterates over each character.
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
42243d3d97 Add more performance logging to completion. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
b1b521e0c2 Fix two history tests added recently.
These were added on master and needed to be adjusted slightly for the
new history check (which doesn't rely on reading a history file
anymore).
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
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
a8ed9f1c2f Fix qute://version sql init bug.
Calling sql.init() in version.version() would replace the existing sql
connection and cause a crash when accessed by opening qute://version.

Now version relies on sql already being initted, and app.py inits sql early if
the --version arg is given.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
231bbe7c2b Fix race condition on history tests.
Two history end2end tests are failing because sqlite is not flushing to disk in
time to be read by the test process. My understanding is that sqlite should
take an exclusive lock while writing, so it is difficult to understand why this
is happening. This can be fixed by adding a delay, but that seems flaky.

I'm fixing it by checking qute://history instead of reading the database file.

See:
https://github.com/qutebrowser/qutebrowser/pull/2295#issuecomment-292786138
and the following discussion.
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
be07107b1c Fix end2end completion tests for SQL backend.
Change the logging to report the completion function name and have the end2end
tests check for this.

Remove the tests for realtime completion, as it was decided this is not an
important feature and the code is much simpler without it.
2017-06-19 07:42:12 -04:00
Florian Bruhin
9b5227b987 Improve test_version output 2017-06-19 09:06:18 +02:00
Florian Bruhin
9cc688ea2b Fix initial tab sizing with vertical tabbar 2017-06-16 23:00:16 +02:00
Iordanis Grigoriou
e14477375b Fix typo in test 2017-06-16 12:41:30 +02:00
Iordanis Grigoriou
f28d523225 Select the last focused tab when running ':tab-focus <current tab number>' 2017-06-16 12:28:56 +02:00
Florian Bruhin
54154e2434 Mark :stop test as flaky
Looks like the requests sometimes aren't updated, but I have no idea why.
2017-06-12 18:15:05 +02:00
Florian Bruhin
38d54cb112 Stabilize history tests
Get current URL right away in :view-source, and wait until source is shown in
the test.
2017-06-12 18:13:17 +02:00
Florian Bruhin
57fbfbd606 Set an initial window size for background tabs
When we open a background tab, it gets a hardcoded size (800x600 or so) because
it doesn't get resized by the layout yet.

By resizing it to the size it'll actually have later, we make sure scrolling to
an anchor in an background tab works, and JS also gets the correct size for
background tabs.

Fixes #1190
Fixes #2495
See #1417
2017-06-11 17:48:01 +02:00
Florian Bruhin
ad260366ef Remove ":messages without messages" test
We can never know for sure there aren't any messages - for example, on Travis we get a message about XDG_RUNTIME_DIR being unset on Qt 5.9.
2017-06-09 11:04:21 +02:00
Florian Bruhin
250da212cd Adjust tests for new QtWebKit-NG 2017-06-09 10:28:41 +02:00
Florian Bruhin
ddf4521305 Fix :messages tests 2017-06-08 14:16:30 +02:00
Florian Bruhin
a5af98b063 Add a few tests for qutebrowser.is_ignored_chromium_message 2017-06-06 16:26:01 +02:00
Florian Bruhin
cb03fb7d80 Make process/thread ID optional for Chromium messages
Looks like at least on Travis they're not always there.
2017-06-06 16:18:53 +02:00
Florian Bruhin
998f93dfd3 tests: Properly parse Chromium logging messages
Closes #2519
2017-06-06 10:01:45 +02:00
Florian Bruhin
73249d8abe Adjust ignored Chromium messages for Qt 5.9 debug builds 2017-06-05 21:57:53 +02:00
Florian Bruhin
eb9a0c01ba Set backend-warning-shown in test_invocations 2017-05-30 16:49:39 +02:00
Florian Bruhin
b32223acc7 Only inherit private mode when window is set
Otherwise, everything calling _open in a private window (like :quickmark-load)
will open a new window.
2017-05-29 06:37:28 +02:00
Florian Bruhin
8bd6974042 Open a window with an empty session
With general -> save-session on and only private windows open, we can easily get
a session file with "windows: []" in it. If we loaded such a file, we got no
windows at all when qutebrowser started.

Fixes #2664
2017-05-28 11:15:51 +02: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
c32c01ffc0 Merge commit '419793c0b9ff4f293babea7623dcaf4787bbaa35' 2017-05-22 07:55:44 +02:00
Jay Kamat
00f001729b
Fix undo with pinned tabs
Add tests for undo with a pinned tab
Add tests for clone with a pinned tab
2017-05-21 21:03:33 -07: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
Florian Bruhin
e3f5e8ca9a Disable local storage test for now
It also seems to run unstable on Windows (AppVeyor), so we probably need to wait
for qutewm to run it.
2017-05-17 20:38:30 +02: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
dd15b4b953 Fix local storage test
Looks like it needs a window manager to run properly...
2017-05-17 13:38:21 +02:00
Florian Bruhin
e0ff2d98fe Test for private browsing differently
In a48ea597d0 we fixed settings in private
QtWebEngine windows.

However, this means we also enable local storage for private windows, which was
disabled in QtWebEngine by default:

4ef5831a39 (diff-44ac7d27348388501944f6a8e2e67d8dR207)

It should be safe to enable it, as we get the same behavior as in Chromium, i.e.
a working local storage which entirely lives in RAM.

This also makes those tests work on QtWebKit-NG, presumably because private
browsing for cookies is implemented there.

It also adds a test to at least check whether local storage is isolated from
non-private tabs. I tried writing a test which ensures nothing lands on the hard
disk, but due to QTBUG-52121 this might not happen at all:

https://bugreports.qt.io/browse/QTBUG-52121
2017-05-17 09:42:28 +02:00
Florian Bruhin
a48ea597d0 Set websettings on each profile's setting object
Turns out QWebEngineSettings.globalSettings() only sets things on the default
profile. We now get everything from the default profile settings, but set it on
both the default and the private profile.

Fixes #2638

(cherry picked from commit b11a4388cd10b6ff2fd917fca689ebdc50d581ae)
2017-05-17 06:31:51 +02:00
Jay Kamat
5e3c68530a
Regenerate documentation 2017-05-16 21:03:33 -07:00
Jay Kamat
1142a19de9
Add (pinned) keyword to 'following tabs open' tests 2017-05-16 20:16:43 -07:00
Florian Bruhin
407537dbe6 tests: Wait until window is closed after :close
If we don't wait here, we might end up running the subsequent commands (like
:command-history-prev) on the old window while it's still closing, causing an
exception at least on AppVeyor:

    Traceback (most recent call last):
      File "C:\projects\qutebrowser\qutebrowser\app.py", line 110, in <lambda>
        target_arg=target_arg))
      File "C:\projects\qutebrowser\qutebrowser\app.py", line 265, in process_pos_args
        win_id = mainwindow.get_window(via_ipc, force_tab=True)
      File "C:\projects\qutebrowser\qutebrowser\mainwindow\mainwindow.py", line 89, in get_window
        window.setWindowState(window.windowState() & ~Qt.WindowMinimized)
    RuntimeError: wrapped C/C++ object of type MainWindow has been deleted
2017-05-16 15:46:20 +02:00
Florian Bruhin
d0dd1644af Set user agent correctly on QtWebEngine 2017-05-16 06:46:45 +02:00
Florian Bruhin
086139110d Merge branch 'new-private-browsing' 2017-05-16 06:32:15 +02:00
Florian Bruhin
c4307c9f03 Fix lint 2017-05-15 11:07:43 +02:00
Florian Bruhin
3f8b9fb1a5 tests: Improve matching of exceptions to show verbose output
In some situations we can get a TypeError without a stack
2017-05-15 11:07:43 +02:00
Florian Bruhin
3c3f695af4 Fix things pointed out in reviews 2017-05-15 11:07:43 +02:00
Florian Bruhin
8993667479 Remove unused imports 2017-05-15 11:02:29 +02:00
Florian Bruhin
c3ac3ccdee Add tests for new private browsing 2017-05-15 11:02:29 +02:00
Florian Bruhin
9805b43c85 Handle private browsing in sessions 2017-05-15 11:02:29 +02:00
Florian Bruhin
157a0af908 Hopefully fix failing history test on old Qt 2017-05-15 10:29:13 +02:00
Florian Bruhin
5b1d35bef9 Don't add data: URLs to history 2017-05-15 09:04:16 +02:00
Jay Kamat
17169812be
Misc cleanup and fixes 2017-05-14 00:21:51 -07:00
Jay Kamat
a5eb3e27f8
Fix some bugs in session saving test case 2017-05-12 17:48:38 -07:00
Jay Kamat
2ae1bfc033
Keep pinned tabs in place rather than moving them. 2017-05-12 13:09:22 -07:00
Jay Kamat
3e3f4b4164
Add :tab-only tests for --force 2017-05-12 11:06:17 -07:00
Jay Kamat
66dfb1b1c9
Fix a bug with titles not being refreshed when pinning tabs 2017-05-12 09:53:25 -07: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
Jay Kamat
4c28487fd0
Warn user if pinned tab is closed via tab-only 2017-05-11 14:30:45 -07:00
Jay Kamat
cb654225fd
Add a test case for loading/saving pinned tabs in sessions 2017-05-11 14:05:25 -07:00
Jay Kamat
3317834b36
Fix a bug where pinned tabs were occasionally miscounted
Example case: :tab-only. This should cover other cases, but currently those
cases (such as :tab-only) do NOT have a warning message when popping up.
2017-05-11 13:28:26 -07:00
Jay Kamat
725bafea54
Merge branch 'master' into jay/pintab 2017-05-10 23:51:33 -07:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Jay Kamat
a3d41c0467
Refactor search method of AbstractBrowserTab into a field 2017-05-09 00:24:13 -07:00
Jay Kamat
02f79c2990
Add tests for manual selection 2017-05-09 00:11:25 -07:00
Jay Kamat
5ba81e3611
Add tests for follow_selected 2017-05-08 22:32:53 -07:00
Florian Bruhin
90b0af97ce Improve serialization crash check
It now works correctly with view-source URLs and is disabled on Qt 5.9.

Fixes #2289
See #2458
2017-05-03 23:15:17 +02:00
Florian Bruhin
ea2d5e97e2 Disable serialization crash check on Qt 5.9 2017-05-03 21:31:09 +02:00
Florian Bruhin
7c6981e512 Remove unused imports 2017-05-02 10:41:51 +02:00
Florian Bruhin
d5c5d09b18 Hopefully stabilize test_version
When using QuteProcess here, we fight with it over who can read the output.
Just use a raw QProcess instead.
2017-05-02 09:12:06 +02:00
Florian Bruhin
7b4ab901e9 tests: Fix Chromium message matching 2017-05-02 08:24:57 +02:00
Florian Bruhin
bffdea6719 Read qWebKitVersion in qtutils.is_webkit_ng.
This means we need to try and import qWebKitVersion in qtutils, but better there
than at every place which calls it.
2017-04-28 21:36:02 +02:00