зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1636911. Add mochitest. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D75665
This commit is contained in:
Родитель
f4338779c4
Коммит
be0074a4d3
|
@ -0,0 +1,170 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html id="root-element">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width; initial-scale=1.0">
|
||||
<title>Checkerboarding in while scrolling a subframe when root scrollframe has
|
||||
overflow hidden and pinch zoomed in</title>
|
||||
<script type="application/javascript" src="apz_test_utils.js"></script>
|
||||
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
|
||||
<script src="/tests/SimpleTest/paint_listener.js"></script>
|
||||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
|
||||
var initial_resolution = getResolution();
|
||||
ok(initial_resolution > 0,
|
||||
"The initial_resolution is " + initial_resolution + ", which is some sane value");
|
||||
|
||||
var subframe = document.getElementById('bugzilla-body');
|
||||
|
||||
// layerize subframe
|
||||
yield synthesizeNativeClickAndWaitForClickEvent(subframe, 10, 10, testDriver);
|
||||
|
||||
// verify layerization
|
||||
yield waitForAllPaints(() => setTimeout(testDriver, 0));
|
||||
ok(isLayerized("bugzilla-body"), "subframe should be layerized at this point");
|
||||
var subframeScrollId = utils.getViewId(subframe);
|
||||
ok(subframeScrollId > 0, "subframe should have a scroll id");
|
||||
|
||||
// wait for the dust to settle
|
||||
yield waitForAllPaints(() => setTimeout(testDriver, 0));
|
||||
|
||||
var waitForTouchEnd = function(e) {
|
||||
dump("touchend listener hit\n");
|
||||
setTimeout(testDriver, 0);
|
||||
};
|
||||
document.documentElement.addEventListener("touchend", waitForTouchEnd, {passive: true, once: false});
|
||||
|
||||
// Ensure that APZ gets updated hit-test info
|
||||
yield waitForAllPaints(() => setTimeout(testDriver, 0));
|
||||
|
||||
var zoom_in = [
|
||||
[ { x: 130, y: 280 }, { x: 150, y: 300 } ],
|
||||
[ { x: 120, y: 250 }, { x: 160, y: 380 } ],
|
||||
[ { x: 115, y: 200 }, { x: 180, y: 410 } ],
|
||||
[ { x: 110, y: 150 }, { x: 200, y: 440 } ],
|
||||
[ { x: 105, y: 120 }, { x: 210, y: 470 } ],
|
||||
[ { x: 100, y: 100 }, { x: 230, y: 500 } ],
|
||||
];
|
||||
|
||||
var touchIds = [0, 1];
|
||||
yield* synthesizeNativeTouchSequences(document.body, zoom_in, null, touchIds);
|
||||
|
||||
yield; // wait for the touchend listener to fire
|
||||
yield; // wait for the touchend listener to fire
|
||||
document.documentElement.removeEventListener("touchend", waitForTouchEnd);
|
||||
|
||||
// Flush state and get the resolution we're at now
|
||||
yield waitForApzFlushedRepaints(testDriver);
|
||||
let final_resolution = getResolution();
|
||||
ok(final_resolution > initial_resolution, "The final resolution (" + final_resolution + ") is greater than the initial resolution");
|
||||
|
||||
|
||||
document.documentElement.addEventListener("touchend", waitForTouchEnd, {passive: true, once: true});
|
||||
|
||||
// pan back up to the top left
|
||||
yield synthesizeNativeTouchDrag(window,
|
||||
5,
|
||||
5,
|
||||
500,
|
||||
500,
|
||||
testDriver,
|
||||
2);
|
||||
|
||||
yield; // wait for the touchend listener to fire
|
||||
|
||||
yield waitForApzFlushedRepaints(testDriver);
|
||||
|
||||
yield waitForAllPaints(() => setTimeout(testDriver, 0));
|
||||
|
||||
document.documentElement.addEventListener("touchend", waitForTouchEnd, {passive: true, once: true});
|
||||
|
||||
// pan right to expose the bug
|
||||
yield synthesizeNativeTouchDrag(window,
|
||||
100,
|
||||
1,
|
||||
-180,
|
||||
0,
|
||||
testDriver,
|
||||
3);
|
||||
|
||||
|
||||
yield; // wait for the touchend listener to fire
|
||||
|
||||
yield waitForApzFlushedRepaints(testDriver);
|
||||
|
||||
var data = utils.getCompositorAPZTestData();
|
||||
//dump(JSON.stringify(data, null, 4));
|
||||
|
||||
var found = false;
|
||||
for (apzcData of data.additionalData) {
|
||||
if (apzcData.key == subframeScrollId) {
|
||||
var checkerboarding = apzcData.value.split(',').includes("checkerboarding");
|
||||
ok(!checkerboarding, "subframe is not checkerboarding");
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
ok(found, "Found the checkerboarding subframe");
|
||||
|
||||
subtestDone();
|
||||
}
|
||||
|
||||
waitUntilApzStable().then(runContinuation(test));
|
||||
|
||||
</script>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
overflow-y: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
position: initial !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#bugzilla-body {
|
||||
flex: auto;
|
||||
position: relative;
|
||||
outline: none;
|
||||
padding: 0 15px;
|
||||
overflow-x: auto;
|
||||
overflow-y: scroll;
|
||||
will-change: transform;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<main id="bugzilla-body">
|
||||
<p>STR:</p>
|
||||
<ol>
|
||||
<li>set <code>apz.allow_zoom</code> to <code>true</code></li>
|
||||
<li>visit any bugzilla site (like this one)</li>
|
||||
<li>zoom into the page and observe the left edge of the viewport</li>
|
||||
</ol>
|
||||
<p>ER: content should be shown<br>
|
||||
AR: foreground content seems to disappear, looks like it's being cut off
|
||||
</p>
|
||||
<p>I attached a video of the STR to show the problem a little bit better. So far, I could only reproduce this on bugzilla. Words words words words words words words words words words words words words words words words words words words words words words.</p>
|
||||
|
||||
<div style="height: 10000px;"></div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -9,6 +9,7 @@
|
|||
if (isApzEnabled()) {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
||||
var prefs = [
|
||||
["apz.test.logging_enabled", true],
|
||||
["apz.paint_skipping.enabled", true],
|
||||
|
@ -16,8 +17,16 @@
|
|||
["general.smoothScroll", false],
|
||||
["apz.minimap.enabled", true], // helps to debug these tests
|
||||
];
|
||||
|
||||
var zoom_and_pan_prefs = [
|
||||
...prefs,
|
||||
...getPrefs("TOUCH_EVENTS:PAN"),
|
||||
["apz.allow_zooming", true],
|
||||
];
|
||||
|
||||
const subtests = [
|
||||
{ file: "helper_checkerboard_apzforcedisabled.html", prefs },
|
||||
{ file: "helper_checkerboard_zoomoverflowhidden.html", "prefs": zoom_and_pan_prefs },
|
||||
];
|
||||
// Run the actual test in its own window, because it requires that the
|
||||
// root APZC be scrollable. Mochitest pages themselves often run
|
||||
|
|
Загрузка…
Ссылка в новой задаче