Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index the session past correctly when discarding. #14860

Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Added a test to make sure that forward-then-back triggers a reload.

  • Loading branch information
asajeffrey committed Jan 6, 2017
commit b401556f03001edb9099335b2936b9871fee50b8
"url": "/_mozilla/mozilla/service-workers/service-worker-registration.html"
}
],
"mozilla/servo-max-session-history.html": [
{
"path": "mozilla/servo-max-session-history.html",
"url": "/_mozilla/mozilla/servo-max-session-history.html"
}
],
"mozilla/sigsegv.html": [
{
"path": "mozilla/sigsegv.html",
@@ -0,0 +1,36 @@
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body></body>
<script>
// This test goes forward by X pages, then back by Y pages,
// then checks to see if that triggered a reload.
// If it did, the document must have been discarded,

// The current page number (stored in the URL search string)
var page_number = location.search.substring(1) | 0;

// The number of pages to go forward by.
// This should be more than go_back_by, to ensure that
// we actually do more than one back traversal.
var go_forward_by = 24;

// The number of pages to go back by.
// This should be more than the default --max-session-history,
// to ensure that going back reloads the page.
var go_back_by = Math.min(page_number, 20);

if (history.length < go_forward_by) {
// Keep loading new pages until we have loaded enough of them.
location.assign("?" + (page_number + 1));
} else if (page_number === 0) {
// If we got back to the beginning, we must have triggered reloads.
test(function() {}, "Forward then back triggered a reload.");
} else {
// Otherwise, go back.
history.go(-go_back_by);
}
</script>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.