Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: LayoutTests/fast/history/scroll-restoration/scroll-restoration-basic.html

Issue 1239463005: Replace history.options with history.scrollRestoration attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move setScrollRestorationType to History Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 body {
4 height: 2000px;
5 width: 2000px;
6 }
7 </style>
8
9 <script src="../../../resources/testharness.js"></script>
10 <script src="../../../resources/testharnessreport.js"></script>
11 <script type="text/javascript">
12 'use strict';
13
14 test(function() {
15 assert_true(history.scrollRestoration !== undefined, 'history.scrollRestorat ion exists');
16 }, 'Basic existence');
17
18 test(function() {
19 assert_equals(history.scrollRestoration, 'auto');
20 }, 'Default value is "auto"');
21
22 test(function() {
23 history.scrollRestoration = 'manual';
24 assert_equals(history.scrollRestoration, 'manual', 'should be able to set "m anual"');
25 history.scrollRestoration = 'auto';
26 assert_equals(history.scrollRestoration, 'auto', 'should be able to set "aut o"');
27 }, 'It is writable');
28
29 test(function() {
30 history.scrollRestoration = 'auto';
31 for (var v of[3.1415, {}, 'bogus']) {
32 history.scrollRestoration = v;
33 assert_equals(history.scrollRestoration, 'auto', `setting to invalid value (${v}) should be ignored`);
34 }
35 }, 'Invalid values are ignored');
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698