Bug 1459913 - fix removable_false test to always execute the correct drag (layout race), rs=test-only
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 10 May 2018 09:44:49 +0100
changeset 417718 184216421caa824bd1b8aa3015ec99481c342fed
parent 417717 fa1ffc8b8d5bf7c4ae998e0e2ad7b9f772fc7a73
child 417719 91ced8101f99044842e7e532edd9b45e54c35bc5
push id33977
push userncsoregi@mozilla.com
push dateThu, 10 May 2018 16:43:24 +0000
treeherdermozilla-central@17db33b6a124 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1459913
milestone62.0a1
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
Bug 1459913 - fix removable_false test to always execute the correct drag (layout race), rs=test-only
browser/components/customizableui/test/browser_allow_dragging_removable_false.js
--- a/browser/components/customizableui/test/browser_allow_dragging_removable_false.js
+++ b/browser/components/customizableui/test/browser_allow_dragging_removable_false.js
@@ -8,16 +8,20 @@ add_task(async function() {
   let forwardButton = document.getElementById("forward-button");
   is(forwardButton.getAttribute("removable"), "false", "forward-button should not be removable");
   ok(CustomizableUI.inDefaultState, "Should start in default state.");
 
   let urlbarContainer = document.getElementById("urlbar-container");
   let placementsAfterDrag = getAreaWidgetIds(CustomizableUI.AREA_NAVBAR);
   placementsAfterDrag.splice(placementsAfterDrag.indexOf("forward-button"), 1);
   placementsAfterDrag.splice(placementsAfterDrag.indexOf("urlbar-container"), 0, "forward-button");
+
+  // Force layout flush to ensure the drag completes as expected
+  urlbarContainer.clientWidth;
+
   simulateItemDrag(forwardButton, urlbarContainer, "start");
   assertAreaPlacements(CustomizableUI.AREA_NAVBAR, placementsAfterDrag);
   ok(!CustomizableUI.inDefaultState, "Should no longer be in default state.");
   let palette = document.getElementById("customization-palette");
   simulateItemDrag(forwardButton, palette);
   is(CustomizableUI.getPlacementOfWidget("forward-button").area, CustomizableUI.AREA_NAVBAR, "forward-button was not able to move to palette");
 
   await endCustomizing();