Bug 951793 - Add a test for the pref that controls overscroll-behavior. r=emilio
MozReview-Commit-ID: 9qIuF1Vdsm4
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -250,16 +250,17 @@ skip-if = android_version == '18' #debug
[test_media_queries_dynamic.html]
[test_media_queries_dynamic_xbl.html]
[test_media_query_list.html]
[test_media_query_serialization.html]
[test_moz_device_pixel_ratio.html]
[test_namespace_rule.html]
[test_non_content_accessible_properties.html]
[test_of_type_selectors.xhtml]
+[test_overscroll_behavior_pref.html]
[test_page_parser.html]
[test_parse_eof.html]
[test_parse_ident.html]
[test_parse_rule.html]
[test_parse_url.html]
[test_parser_diagnostics_unprintables.html]
[test_pixel_lengths.html]
[test_pointer-events.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_overscroll_behavior_pref.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>Test pref for overscroll-behavior property</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ </head>
+<script class="testbody" type="text/javascript">
+function runTest() {
+ let css = "div { overscroll-behavior: auto; }";
+ let style = document.createElement('style');
+ style.appendChild(document.createTextNode(css));
+ document.head.appendChild(style);
+
+ is(document.styleSheets[0].cssRules[0].style.length,
+ 0,
+ "overscroll-behavior shouldn't be parsed if the pref is off");
+ SimpleTest.finish();
+}
+SpecialPowers.pushPrefEnv({ set: [["layout.css.overscroll-behavior.enabled", false]] },
+ runTest);
+SimpleTest.waitForExplicitFinish();
+</script>
+</html>