author Jan Henning <>
Sat, 12 Jan 2019 18:34:54 +0000
changeset 453639 81378c45a359
parent 453580 80aa2eb75893
child 456165 c194c666f232
permissions -rw-r--r--
Bug 1517976 - Test that resetting WindowUtils.isFirstPaint doesn't clobber APZ scroll position. r=botond We need to setup a case where the visual viewport is smaller than the layout viewport. Faking a pinch zoom through touch events is imprecise, whereas calling windowUtils.setResolutionAndScaleTo(value > 1) to simulate the equivalent effect of a pinch-zoom on the page led to the subsequent scroll attempt failing quite often even after calling waitForApzFlushedRepaints(). So instead, we set up a very wide layout viewport through the meta viewport tag, which on Desktop means additionally enabling the dom.meta-viewport.enabled pref. Differential Revision:

  <meta charset="utf-8">
  <title>Various touch tests that spawn in new windows (4)</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript">

var basic_pan_prefs = getPrefs("TOUCH_EVENTS:PAN");

var subtests = [
  // clicking on element with :active::after CSS property
  {"file": "helper_bug1473108.html"},
  // Resetting isFirstPaint shouldn't clobber the visual viewport
  {"file": "helper_bug1509575.html", "prefs": [...basic_pan_prefs, ["dom.meta-viewport.enabled", true]]},
  // Add new subtests here. If this starts timing out because it's taking too
  // long, create a test_group_touchevents-5.html file. Refer to 1423011#c57
  // for more details.

if (isApzEnabled()) {
  ok(window.TouchEvent, "Check if TouchEvent is supported (it should be, the test harness forces it on everywhere)");
  if (getPlatform() == "android") {
    // This has a lot of subtests, and Android emulators are slow.

  window.onload = function() {
    .then(SimpleTest.finish, SimpleTest.finish);