Bug 1273654 - Merge the subtests from test_basic_pan into test_group_touchevents. r=botond

MozReview-Commit-ID: Huc2bRaaW6p
This commit is contained in:
Kartikaya Gupta 2016-05-25 15:31:52 -04:00
Родитель 7f3e0d8258
Коммит 01bfc7401c
7 изменённых файлов: 39 добавлений и 88 удалений

Просмотреть файл

@ -189,8 +189,8 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
w = window.open('', "_blank"); w = window.open('', "_blank");
w.subtestDone = advanceSubtestExecution; w.subtestDone = advanceSubtestExecution;
w.SimpleTest = SimpleTest; w.SimpleTest = SimpleTest;
w.is = is; w.is = function(a, b, msg) { return is(a, b, aFile + " | " + msg); };
w.ok = ok; w.ok = function(cond, name, diag) { return ok(cond, aFile + " | " + name, diag); };
w.location = location.href.substring(0, location.href.lastIndexOf('/') + 1) + aFile; w.location = location.href.substring(0, location.href.lastIndexOf('/') + 1) + aFile;
return w; return w;
} }

Просмотреть файл

@ -23,8 +23,8 @@ function scrollPage() {
} }
function checkScroll() { function checkScroll() {
window.opener.is(window.scrollY, 50, "check that the window scrolled"); is(window.scrollY, 50, "check that the window scrolled");
window.opener.testDone(); subtestDone();
} }
window.onload = function() { window.onload = function() {

Просмотреть файл

@ -24,8 +24,8 @@ function scrollOuter() {
function checkScroll() { function checkScroll() {
var outerScroll = document.getElementById('outer').scrollTop; var outerScroll = document.getElementById('outer').scrollTop;
window.opener.is(outerScroll, 50, "check that the div scrolled"); is(outerScroll, 50, "check that the div scrolled");
window.opener.testDone(); subtestDone();
} }
window.onload = function() { window.onload = function() {

Просмотреть файл

@ -25,8 +25,8 @@ function scrollOuter() {
function checkScroll() { function checkScroll() {
var outerScroll = document.getElementById('outer').contentWindow.scrollY; var outerScroll = document.getElementById('outer').contentWindow.scrollY;
window.opener.is(outerScroll, 50, "check that the iframe scrolled"); is(outerScroll, 50, "check that the iframe scrolled");
window.opener.testDone(); subtestDone();
} }
window.onload = function() { window.onload = function() {

Просмотреть файл

@ -29,10 +29,6 @@ skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel ev
skip-if = (os == 'android') || (os == 'b2g') # wheel events not supported on mobile skip-if = (os == 'android') || (os == 'b2g') # wheel events not supported on mobile
[test_layerization.html] [test_layerization.html]
skip-if = (os == 'android') || (os == 'b2g') # uses wheel events which are not supported on mobile skip-if = (os == 'android') || (os == 'b2g') # uses wheel events which are not supported on mobile
[test_basic_pan.html]
# Windows touch injection doesn't work in automation, but this test can be run locally on a windows touch device.
# On OS X we don't support touch events at all.
skip-if = (toolkit == 'windows') || (toolkit == 'cocoa')
[test_scroll_inactive_flattened_frame.html] [test_scroll_inactive_flattened_frame.html]
skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet
[test_scroll_inactive_bug1190112.html] [test_scroll_inactive_bug1190112.html]

Просмотреть файл

@ -1,76 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Sanity panning test</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
// this page just serially loads each one of the following test helper pages in
// a new window and waits for it to call testDone()
var tests = [
'helper_basic_pan.html',
'helper_div_pan.html',
'helper_iframe_pan.html',
];
var testIndex = -1;
var w = null;
function testDone() {
if (w) {
w.close();
}
testIndex++;
if (testIndex < tests.length) {
w = window.open(tests[testIndex], "_blank");
} else {
SimpleTest.finish();
}
}
window.onload = function() {
if (!SpecialPowers.getDOMWindowUtils(window).asyncPanZoomEnabled) {
ok(true, "APZ is not enabled, this test is not relevant, sorry!\n");
SimpleTest.finish();
return;
}
if (!window.TouchEvent) {
ok(true, "Touch events are not supported on this platform, sorry!\n");
SimpleTest.finish();
return;
}
SpecialPowers.pushPrefEnv(
{ "set":
[
// Dropping the touch slop to 0 makes the tests easier to write because
// we can just do a one-pixel drag to get over the pan threshold rather
// than having to hard-code some larger value.
["apz.touch_start_tolerance", "0.0"],
// The touchstart from the drag can turn into a long-tap if the touch-move
// events get held up. Try to prevent that by making long-taps require
// a 10 second hold. Note that we also cannot enable chaos mode on this
// test for this reason, since chaos mode can cause the long-press timer
// to fire sooner than the pref dictates.
["ui.click_hold_context_menus.delay", 10000],
// The subtests in this test do touch-drags to pan the page, but we don't
// want those pans to turn into fling animations, so we increase the
// fling-stop threshold velocity to absurdly high.
["apz.fling_stopped_threshold", "10000"],
// The helper_div_pan's div gets a displayport on scroll, but if the
// test takes too long the displayport can expire before the new scroll
// position is synced back to the main thread. So we disable displayport
// expiry for these tests.
["apz.displayport_expiry_ms", 0],
]
}, testDone);
};
</script>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -8,17 +8,48 @@
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript"> <script type="application/javascript">
var basic_pan_prefs = [
// Dropping the touch slop to 0 makes the tests easier to write because
// we can just do a one-pixel drag to get over the pan threshold rather
// than having to hard-code some larger value.
["apz.touch_start_tolerance", "0.0"],
// The touchstart from the drag can turn into a long-tap if the touch-move
// events get held up. Try to prevent that by making long-taps require
// a 10 second hold. Note that we also cannot enable chaos mode on this
// test for this reason, since chaos mode can cause the long-press timer
// to fire sooner than the pref dictates.
["ui.click_hold_context_menus.delay", 10000],
// The subtests in this test do touch-drags to pan the page, but we don't
// want those pans to turn into fling animations, so we increase the
// fling-stop threshold velocity to absurdly high.
["apz.fling_stopped_threshold", "10000"],
// The helper_div_pan's div gets a displayport on scroll, but if the
// test takes too long the displayport can expire before the new scroll
// position is synced back to the main thread. So we disable displayport
// expiry for these tests.
["apz.displayport_expiry_ms", 0],
];
var subtests = [ var subtests = [
// Simple tests to exercise basic panning behaviour
{'file': 'helper_basic_pan.html', 'prefs': basic_pan_prefs},
{'file': 'helper_div_pan.html', 'prefs': basic_pan_prefs},
{'file': 'helper_iframe_pan.html', 'prefs': basic_pan_prefs},
// Simple test to exercise touch-tapping behaviour
{'file': 'helper_tap.html'}, {'file': 'helper_tap.html'},
// For the following two tests, disable displayport suppression to make sure it // For the following two tests, disable displayport suppression to make sure it
// doesn't interfere with the test by scheduling paints non-deterministically. // doesn't interfere with the test by scheduling paints non-deterministically.
{'file': 'helper_scrollto_tap.html?true', 'prefs': [["apz.paint_skipping.enabled", true]], 'dp_suppression': false}, {'file': 'helper_scrollto_tap.html?true', 'prefs': [["apz.paint_skipping.enabled", true]], 'dp_suppression': false},
{'file': 'helper_scrollto_tap.html?false', 'prefs': [["apz.paint_skipping.enabled", false]], 'dp_suppression': false}, {'file': 'helper_scrollto_tap.html?false', 'prefs': [["apz.paint_skipping.enabled", false]], 'dp_suppression': false},
// For the long-tap test, reduce the content response timeout because the touchstart // For the long-tap test, reduce the content response timeout because the touchstart
// event doesn't get processed (because of the event listener) until this expires. // event doesn't get processed (because of the event listener) until this expires.
// Once we support passive event listeners, we can use that instead and stop mucking // Once we support passive event listeners, we can use that instead and stop mucking
// with the timeout. // with the timeout.
{'file': 'helper_long_tap.html'}, {'file': 'helper_long_tap.html'},
// For the following test, we want to make sure APZ doesn't wait for a content // For the following test, 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 // 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 // timeout to a day, so that the entire test times out and fails if APZ does