Add tests for #879
This commit is contained in:
parent
5a5e8167dd
commit
a6a2210ce8
16
tests/integration/data/sessions/history_replace_state.html
Normal file
16
tests/integration/data/sessions/history_replace_state.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test title</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.onload = function () {
|
||||||
|
console.log("Calling history.replaceState");
|
||||||
|
history.replaceState({}, '', window.location + '?state=2');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
This page calls history.replaceState() via JS.
|
||||||
|
</body>
|
||||||
|
</html>
|
31
tests/integration/features/sessions.feature
Normal file
31
tests/integration/features/sessions.feature
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
Feature: Saving and loading sessions
|
||||||
|
|
||||||
|
# https://github.com/The-Compiler/qutebrowser/issues/879
|
||||||
|
|
||||||
|
Scenario: Saving a session with a page using history.replaceState()
|
||||||
|
When I open data/sessions/history_replace_state.html
|
||||||
|
Then the javascript message "Calling history.replaceState" should be logged
|
||||||
|
And the session should look like:
|
||||||
|
windows:
|
||||||
|
- tabs:
|
||||||
|
- history:
|
||||||
|
- url: about:blank
|
||||||
|
- active: true
|
||||||
|
url: http://localhost:*/data/sessions/history_replace_state.html?state=2
|
||||||
|
title: Test title
|
||||||
|
|
||||||
|
Scenario: Saving a session with a page using history.replaceState() and navigating away
|
||||||
|
When I open data/sessions/history_replace_state.html
|
||||||
|
And I open data/hello.txt
|
||||||
|
Then the javascript message "Calling history.replaceState" should be logged
|
||||||
|
And the session should look like:
|
||||||
|
windows:
|
||||||
|
- tabs:
|
||||||
|
- history:
|
||||||
|
- url: about:blank
|
||||||
|
- url: http://localhost:*/data/sessions/history_replace_state.html?state=2
|
||||||
|
# What we'd *really* expect here is "Test title", but that
|
||||||
|
# workaround is the best we can do.
|
||||||
|
title: http://localhost:*/data/sessions/history_replace_state.html?state=2
|
||||||
|
- active: true
|
||||||
|
url: http://localhost:*/data/hello.txt
|
21
tests/integration/features/test_sessions.py
Normal file
21
tests/integration/features/test_sessions.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
|
||||||
|
|
||||||
|
# Copyright 2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
|
||||||
|
#
|
||||||
|
# This file is part of qutebrowser.
|
||||||
|
#
|
||||||
|
# qutebrowser is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# qutebrowser is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import pytest_bdd as bdd
|
||||||
|
bdd.scenarios('sessions.feature')
|
Loading…
Reference in New Issue
Block a user