test_group_touchevents-6.html (3422B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Various touch tests that spawn in new windows (6)</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <script type="application/javascript" src="apz_test_native_event_utils.js"></script> 8 <script type="application/javascript" src="apz_test_utils.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 <script type="application/javascript"> 11 12 const hover_test_prefs = [ 13 // Shorten touch_hover.delay_ms to set :hover state without any delay. 14 ["ui.touch_hover.delay_ms", 0], 15 // Synthesizing mousemove on reflow causes unexpected :hover state 16 // while the page is loading. 17 ["layout.reflow.synthMouseMove", false], 18 // Avoid opening contextmenu. 19 ["ui.click_hold_context_menus.delay", 10000] 20 ]; 21 22 var subtests = [ 23 {"file": "helper_event_during_fast_fling.html", 24 "prefs": [["apz.touch_start_tolerance", "0.0"], 25 ["apz.android.chrome_fling_physics.friction", "0.0001"], 26 ["apz.fling_friction", "0.0001"], 27 ["apz.fling_stopped_threshold", "0"], 28 ["apz.velocity_relevance_time_ms", "1000"], 29 ["apz.fling_min_velocity_threshold", "0.0"]]}, 30 {"file": "helper_no_synth_mousemove_after_pan.html", 31 "prefs": [["layout.reflow.synthMouseMove", true], 32 // Avoid to the pan gesture is treated as on-touch-pinch-zoom gesture on Android. 33 ["apz.max_tap_time", 0], 34 ...getPrefs("TOUCH_EVENTS:PAN")]}, 35 {"file": "helper_hover_state.html", "prefs": hover_test_prefs}, 36 {"file": "helper_hover_state_with_touch_action_none.html", "prefs": hover_test_prefs}, 37 {"file": "helper_hover_state_with_event_listener.html", "prefs": hover_test_prefs}, 38 {"file": "helper_hover_state_with_prevent_default_on_touchmove.html", "prefs": hover_test_prefs}, 39 {"file": "helper_hover_state_while_scroll.html", "prefs": [ 40 ...hover_test_prefs, 41 ["apz.touch_start_tolerance", "0.0"] 42 ]}, 43 {"file": "helper_hover_state_with_prevent_default_on_touchstart.html", "prefs": hover_test_prefs}, 44 // These two tests check whether each scheduled :hover or :active task 45 // will not leak when the target document is destroyed. 46 {"file": "helper_cancel_active_task.html", 47 "prefs": [["ui.touch_active.delay_ms", 10000], 48 ["ui.click_hold_context_menus.delay", 1000000], 49 ["test.events.async.enabled", true] 50 ]}, 51 {"file": "helper_cancel_hover_task.html", 52 "prefs": [["ui.touch_hover.delay_ms", 10000], 53 ["ui.click_hold_context_menus.delay", 1000000], 54 ["test.events.async.enabled", true] 55 ]}, 56 {"file": "helper_bug1989868.html", 57 "prefs": getPrefs("TOUCH_EVENTS:PAN")}, 58 59 // Add new subtests here. If this starts timing out because it's taking too 60 // long, create a test_group_touchevents-7.html file. Refer to 1423011#c57 61 // for more details. 62 ]; 63 64 if (isApzEnabled()) { 65 ok(window.TouchEvent, "Check if TouchEvent is supported (it should be, the test harness forces it on everywhere)"); 66 if (getPlatform() == "android") { 67 // This has a lot of subtests, and Android emulators are slow. 68 SimpleTest.requestLongerTimeout(2); 69 } 70 71 SimpleTest.waitForExplicitFinish(); 72 window.onload = function() { 73 runSubtestsSeriallyInFreshWindows(subtests) 74 .then(SimpleTest.finish, SimpleTest.finishWithFailure); 75 }; 76 } 77 78 </script> 79 </head> 80 <body> 81 </body> 82 </html>