Index: LayoutTests/fast/history/scroll-restoration/scroll-restoration-basic.html |
diff --git a/LayoutTests/fast/history/scroll-restoration/scroll-restoration-basic.html b/LayoutTests/fast/history/scroll-restoration/scroll-restoration-basic.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..31cd93ab400926ea3147bb36a3934df3fa8e6885 |
--- /dev/null |
+++ b/LayoutTests/fast/history/scroll-restoration/scroll-restoration-basic.html |
@@ -0,0 +1,36 @@ |
+<!DOCTYPE html> |
+<style> |
+ body { |
+ height: 2000px; |
+ width: 2000px; |
+ } |
+</style> |
+ |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script type="text/javascript"> |
+ 'use strict'; |
+ |
+ test(function() { |
+ assert_true(history.scrollRestoration !== undefined, 'history.scrollRestoration exists'); |
+ }, 'Basic existence'); |
+ |
+ test(function() { |
+ assert_equals(history.scrollRestoration, 'auto'); |
+ }, 'Default value is "auto"'); |
+ |
+ test(function() { |
+ history.scrollRestoration = 'manual'; |
+ assert_equals(history.scrollRestoration, 'manual', 'should be able to set "manual"'); |
+ history.scrollRestoration = 'auto'; |
+ assert_equals(history.scrollRestoration, 'auto', 'should be able to set "auto"'); |
+ }, 'It is writable'); |
+ |
+ test(function() { |
+ history.scrollRestoration = 'auto'; |
+ for (var v of[3.1415, {}, 'bogus']) { |
+ history.scrollRestoration = v; |
+ assert_equals(history.scrollRestoration, 'auto', `setting to invalid value (${v}) should be ignored`); |
+ } |
+ }, 'Invalid values are ignored'); |
+</script> |