зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1504659) for browser_scroll.js failures CLOSED TREE
Backed out changeset bcebb3fd72d3 (bug 1504659) Backed out changeset 1dbe3852e298 (bug 1504659)
This commit is contained in:
Родитель
39a9317d64
Коммит
8b45f141ca
|
@ -52,7 +52,6 @@ tags = devtools geolocation
|
|||
skip-if = true # Bug 1413765
|
||||
[browser_preloaded_newtab.js]
|
||||
[browser_screenshot_button.js]
|
||||
[browser_scroll.js]
|
||||
[browser_state_restore.js]
|
||||
[browser_tab_close.js]
|
||||
[browser_tab_remoteness_change.js]
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* This test is checking that keyboard scrolling of content in RDM
|
||||
* behaves correctly, both with and without touch simulation enabled.
|
||||
*/
|
||||
|
||||
const TEST_URL = "data:text/html;charset=utf-8," +
|
||||
"<div style=\"background:blue; width:200px; height:200px\"></div>";
|
||||
|
||||
addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||
info("Turning off keyboard APZ for this test.");
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["apz.keyboard.enabled", false]],
|
||||
});
|
||||
|
||||
await setViewportSize(ui, manager, 100, 100);
|
||||
const browser = ui.getViewportBrowser();
|
||||
|
||||
info("Setting focus on the browser.");
|
||||
browser.focus();
|
||||
|
||||
info("Testing scroll behavior with touch simulation OFF.");
|
||||
await testScrollingOfContent(ui);
|
||||
|
||||
// Run the tests again with touch simulation on.
|
||||
const reloadNeeded = await ui.updateTouchSimulation(true);
|
||||
if (reloadNeeded) {
|
||||
info("Reload is needed -- waiting for it.");
|
||||
const reload = waitForViewportLoad(ui);
|
||||
browser.reload();
|
||||
await reload;
|
||||
|
||||
await ContentTask.spawn(browser, null, () => {
|
||||
content.scrollTo(0, 0);
|
||||
});
|
||||
}
|
||||
|
||||
info("Testing scroll behavior with touch simulation ON.");
|
||||
await testScrollingOfContent(ui);
|
||||
});
|
||||
|
||||
async function testScrollingOfContent(ui) {
|
||||
let x, y;
|
||||
let scroll;
|
||||
|
||||
info("Checking initial scroll conditions.");
|
||||
({x, y} = await getViewportScroll(ui));
|
||||
is(x, 0, "Content should load with scrollX 0.");
|
||||
is(y, 0, "Content should load with scrollY 0.");
|
||||
|
||||
scroll = waitForViewportScroll(ui);
|
||||
EventUtils.synthesizeKey("KEY_ArrowDown");
|
||||
await scroll;
|
||||
({x, y} = await getViewportScroll(ui));
|
||||
isnot(y, 0, "Down arrow key should scroll down by at least some amount.");
|
||||
|
||||
scroll = waitForViewportScroll(ui);
|
||||
EventUtils.synthesizeKey("KEY_ArrowRight");
|
||||
await scroll;
|
||||
({x, y} = await getViewportScroll(ui));
|
||||
isnot(x, 0, "Right arrow key should scroll right by at least some amount.");
|
||||
}
|
|
@ -332,13 +332,6 @@ function getContentSize(ui) {
|
|||
}));
|
||||
}
|
||||
|
||||
function getViewportScroll(ui) {
|
||||
return spawnViewportTask(ui, {}, () => ({
|
||||
x: content.scrollX,
|
||||
y: content.scrollY,
|
||||
}));
|
||||
}
|
||||
|
||||
async function waitForPageShow(browser) {
|
||||
const tab = gBrowser.getTabForBrowser(browser);
|
||||
const ui = ResponsiveUIManager.getResponsiveUIForTab(tab);
|
||||
|
@ -356,10 +349,6 @@ function waitForViewportLoad(ui) {
|
|||
return BrowserTestUtils.waitForContentEvent(ui.getViewportBrowser(), "load", true);
|
||||
}
|
||||
|
||||
function waitForViewportScroll(ui) {
|
||||
return BrowserTestUtils.waitForContentEvent(ui.getViewportBrowser(), "scroll", true);
|
||||
}
|
||||
|
||||
function load(browser, url) {
|
||||
const loaded = BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
const { addViewport, resizeViewport } =
|
||||
require("devtools/client/responsive.html/actions/viewports");
|
||||
const { toggleTouchSimulation } = require("devtools/client/responsive.html/actions/ui");
|
||||
|
||||
add_task(async function() {
|
||||
const store = Store();
|
||||
|
@ -16,14 +15,7 @@ add_task(async function() {
|
|||
dispatch(addViewport());
|
||||
dispatch(resizeViewport(0, 500, 500));
|
||||
|
||||
let viewport = getState().viewports[0];
|
||||
const viewport = getState().viewports[0];
|
||||
equal(viewport.width, 500, "Resized width of 500");
|
||||
equal(viewport.height, 500, "Resized height of 500");
|
||||
|
||||
dispatch(toggleTouchSimulation(true));
|
||||
dispatch(resizeViewport(0, 400, 400));
|
||||
|
||||
viewport = getState().viewports[0];
|
||||
equal(viewport.width, 400, "Resized width of 400 (with touch simulation on)");
|
||||
equal(viewport.height, 400, "Resized height of 400 (with touch simulation on)");
|
||||
});
|
||||
|
|
|
@ -401,6 +401,10 @@ void MobileViewportManager::RefreshVisualViewportSize() {
|
|||
// This function is a subset of RefreshViewportSize, and only updates the
|
||||
// visual viewport size.
|
||||
|
||||
if (!gfxPrefs::APZAllowZooming()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScreenIntSize displaySize = ViewAs<ScreenPixel>(
|
||||
mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds);
|
||||
|
||||
|
@ -476,10 +480,6 @@ void MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution) {
|
|||
if (gfxPrefs::APZAllowZooming()) {
|
||||
UpdateResolution(viewportInfo, displaySize, viewport,
|
||||
displayWidthChangeRatio, UpdateType::ViewportSize);
|
||||
} else {
|
||||
// Even without zoom, we need to update that the visual viewport size
|
||||
// has changed.
|
||||
RefreshVisualViewportSize();
|
||||
}
|
||||
if (gfxPlatform::AsyncPanZoomEnabled()) {
|
||||
UpdateDisplayPortMargins();
|
||||
|
|
Загрузка…
Ссылка в новой задаче