Backed out 2 changesets (bug 1504659) for mochitest failures on test_innerWidthHeight_script.html . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 05 Dec 2018 22:19:24 +0200
changeset 508673 4e65e04a0d2bdfa613ee1623b7bd6bd1003a152b
parent 508672 945ae1cf83ec8dd7c811044f8cabf52c0252bfd8
child 508693 0bcaabfc8a1d39d96314a881d3ea9989c025a8fa
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1504659
milestone65.0a1
backs outf2574f5b186e520f5ee9a1626c8bc828f2761bf1
45f63618f66e184f8b20da48fe37fb3f546094f2
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1504659) for mochitest failures on test_innerWidthHeight_script.html . CLOSED TREE Backed out changeset f2574f5b186e (bug 1504659) Backed out changeset 45f63618f66e (bug 1504659)
devtools/client/responsive.html/test/browser/browser.ini
devtools/client/responsive.html/test/browser/browser_scroll.js
devtools/client/responsive.html/test/browser/head.js
devtools/client/responsive.html/test/unit/test_resize_viewport.js
layout/base/MobileViewportManager.cpp
--- a/devtools/client/responsive.html/test/browser/browser.ini
+++ b/devtools/client/responsive.html/test/browser/browser.ini
@@ -47,17 +47,16 @@ tags = devtools webextensions
 skip-if = true # Bug 1413765
 [browser_network_throttling.js]
 [browser_page_state.js]
 [browser_permission_doorhanger.js]
 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]
 [browser_target_blank.js]
 [browser_telemetry_activate_rdm.js]
 [browser_toolbox_computed_view.js]
 [browser_toolbox_rule_view.js]
 [browser_toolbox_rule_view_reload.js]
deleted file mode 100644
--- a/devtools/client/responsive.html/test/browser/browser_scroll.js
+++ /dev/null
@@ -1,75 +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 scroll;
-
-  info("Checking initial scroll conditions.");
-  const viewportScroll = await getViewportScroll(ui);
-  is(viewportScroll.x, 0, "Content should load with scrollX 0.");
-  is(viewportScroll.y, 0, "Content should load with scrollY 0.");
-
-  /**
-   * Here we're going to send off some arrow key events to trigger scrolling.
-   * What we would like to be able to do is to await the scroll event and then
-   * check the scroll position to confirm the amount of scrolling that has
-   * happened. Unfortunately, APZ makes the scrolling happen asynchronously on
-   * the compositor thread, and it's very difficult to await the end state of
-   * the APZ animation -- see the tests in /gfx/layers/apz/test/mochitest for
-   * an example. For our purposes, it's sufficient to test that the scroll
-   * event is fired at all, and not worry about the amount of scrolling that
-   * has occurred at the time of the event. If the key events don't trigger
-   * scrolling, then no event will be fired and the test will time out.
-   */
-  scroll = waitForViewportScroll(ui);
-  EventUtils.synthesizeKey("KEY_ArrowDown");
-  await scroll;
-  info("Scroll event was fired after arrow key down.");
-
-  scroll = waitForViewportScroll(ui);
-  EventUtils.synthesizeKey("KEY_ArrowRight");
-  await scroll;
-  info("Scroll event was fired after arrow key right.");
-}
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -327,23 +327,16 @@ function getSessionHistory(browser) {
 
 function getContentSize(ui) {
   return spawnViewportTask(ui, {}, () => ({
     width: content.screen.width,
     height: content.screen.height,
   }));
 }
 
-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);
   if (ui) {
     browser = ui.getViewportBrowser();
   }
   info("Waiting for pageshow from " + (ui ? "responsive" : "regular") + " browser");
   // Need to wait an extra tick after pageshow to ensure everyone is up-to-date,
@@ -351,20 +344,16 @@ async function waitForPageShow(browser) 
   await BrowserTestUtils.waitForContentEvent(browser, "pageshow");
   return waitForTick();
 }
 
 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);
   return loaded;
 }
 
 function back(browser) {
   const shown = waitForPageShow(browser);
--- a/devtools/client/responsive.html/test/unit/test_resize_viewport.js
+++ b/devtools/client/responsive.html/test/unit/test_resize_viewport.js
@@ -2,28 +2,20 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test resizing the viewport.
 
 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();
   const { getState, dispatch } = store;
 
   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)");
 });
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -392,16 +392,20 @@ void MobileViewportManager::UpdateDispla
         scrollable, nsLayoutUtils::RepaintMode::DoNotRepaint);
   }
 }
 
 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);
 
   CSSToLayoutDeviceScale cssToDev =
       mPresShell->GetPresContext()->CSSToDevPixelScale();
   LayoutDeviceToLayerScale res(mPresShell->GetResolution());
   CSSToScreenScale zoom = ViewTargetAs<ScreenPixel>(
       cssToDev * res / ParentLayerToLayerScale(1),
@@ -467,20 +471,16 @@ void MobileViewportManager::RefreshViewp
   // If it's the first-paint or the viewport changed, we need to update
   // various APZ properties (the zoom and some things that might depend on it)
   MVM_LOG("%p: Updating properties because %d || %d\n", this, mIsFirstPaint,
           mMobileViewportSize != viewport);
 
   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();
   }
 
   CSSSize oldSize = mMobileViewportSize;
 
   // Update internal state.