Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<meta charset="utf-8">
<title>Various touch tests that spawn in new windows (2)</title>
<script 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 isWindows = getPlatform() == "windows";
const shared_prefs = [
["apz.test.fails_with_native_injection", isWindows],
["dom.w3c_touch_events.legacy_apis.enabled", true],
var subtests = [
// Taps on media elements to make sure the touchend event is delivered
// properly. We increase the long-tap timeout to ensure it doesn't get trip
// during the tap.
// Also this test (on Windows) cannot satisfy the OS requirement of providing
// an injected touch event every 100ms, because it waits for a paint between
// the touchstart and the touchend, so we have to use the "fake injection"
// code instead.
{"file": "helper_bug1162771.html", "prefs": [...shared_prefs,
["ui.click_hold_context_menus.delay", 10000]]},
// As with the previous test, this test cannot inject touch events every 100ms
// because it waits for a long-tap, so we have to use the "fake injection" code
// instead.
// This test also disables synthesized mousemoves from reflow so it can make
// more precise assertions about the order in which events arrive.
{"file": "helper_long_tap.html", "prefs": [...shared_prefs,
["layout.reflow.synthMouseMove", false]]},
// For the following tests, we want to make sure APZ doesn't wait for a content
// response that is never going to arrive. To detect this we set the content response
// timeout to a day, so that the entire test times out and fails if APZ does
// end up waiting.
{"file": "helper_tap_passive.html", "prefs": [...shared_prefs,
["apz.content_response_timeout", 24 * 60 * 60 * 1000]]},
{"file": "helper_tap_default_passive.html", "prefs": [...shared_prefs,
["apz.content_response_timeout", 24 * 60 * 60 * 1000]]},
// Add new subtests to test_group_touch_events-4.html, not this file.
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.finishWithFailure);