Bug 1492582 - Fix browser drag tests when using HTML root element. r=Gijs
authorBrendan Dahl <bdahl@mozilla.com>
Fri, 08 Nov 2019 23:34:01 +0000
changeset 501406 e4d31ac43ad03c703b4282693a4e537848375bd6
parent 501405 cd43140ba52879d74162066e1531e36ac32df1b8
child 501407 d9fa29c55c42606dd014abe3816667384d19288e
push id36791
push usercsabou@mozilla.com
push dateSun, 10 Nov 2019 09:53:30 +0000
treeherdermozilla-central@72c52c0101cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1492582
milestone72.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 1492582 - Fix browser drag tests when using HTML root element. r=Gijs When using an HTML root these tests failed because the source drag element is not visible. Differential Revision: https://phabricator.services.mozilla.com/D50674
browser/base/content/test/general/browser_homeDrop.js
browser/base/content/test/general/browser_newTabDrop.js
browser/base/content/test/general/browser_newWindowDrop.js
--- a/browser/base/content/test/general/browser_homeDrop.js
+++ b/browser/base/content/test/general/browser_homeDrop.js
@@ -7,19 +7,20 @@ add_task(async function() {
   await pushPrefs([HOMEPAGE_PREF, "about:mozilla"]);
 
   let EventUtils = {};
   Services.scriptloader.loadSubScript(
     "chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
     EventUtils
   );
 
-  // Since synthesizeDrop triggers the srcElement, need to use another button.
-  let dragSrcElement = document.getElementById("downloads-button");
-  ok(dragSrcElement, "Downloads button exists");
+  // Since synthesizeDrop triggers the srcElement, need to use another button
+  // that should be visible.
+  let dragSrcElement = document.getElementById("sidebar-button");
+  ok(dragSrcElement, "Sidebar button exists");
   let homeButton = document.getElementById("home-button");
   ok(homeButton, "home button present");
 
   async function drop(dragData, homepage) {
     let setHomepageDialogPromise = BrowserTestUtils.domWindowOpened();
 
     EventUtils.synthesizeDrop(
       dragSrcElement,
--- a/browser/base/content/test/general/browser_newTabDrop.js
+++ b/browser/base/content/test/general/browser_newTabDrop.js
@@ -204,19 +204,20 @@ async function drop(dragData, expectedUR
     }`
   );
   let EventUtils = {};
   Services.scriptloader.loadSubScript(
     "chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
     EventUtils
   );
 
-  // Since synthesizeDrop triggers the srcElement, need to use another button.
-  let dragSrcElement = document.getElementById("downloads-button");
-  ok(dragSrcElement, "Downloads button exists");
+  // Since synthesizeDrop triggers the srcElement, need to use another button
+  // that should be visible.
+  let dragSrcElement = document.getElementById("sidebar-button");
+  ok(dragSrcElement, "Sidebar button exists");
   let newTabButton = document.getElementById("new-tab-button");
   ok(newTabButton, "New Tab button exists");
 
   let awaitDrop = BrowserTestUtils.waitForEvent(newTabButton, "drop");
 
   let loadedPromises = expectedURLs.map(url =>
     BrowserTestUtils.waitForNewTab(gBrowser, url, false, true)
   );
--- a/browser/base/content/test/general/browser_newWindowDrop.js
+++ b/browser/base/content/test/general/browser_newWindowDrop.js
@@ -191,19 +191,20 @@ async function drop(dragData, expectedUR
     }`
   );
   let EventUtils = {};
   Services.scriptloader.loadSubScript(
     "chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
     EventUtils
   );
 
-  // Since synthesizeDrop triggers the srcElement, need to use another button.
-  let dragSrcElement = document.getElementById("downloads-button");
-  ok(dragSrcElement, "Downloads button exists");
+  // Since synthesizeDrop triggers the srcElement, need to use another button
+  // that should be visible.
+  let dragSrcElement = document.getElementById("sidebar-button");
+  ok(dragSrcElement, "Sidebar button exists");
   let newWindowButton = document.getElementById("new-window-button");
   ok(newWindowButton, "New Window button exists");
 
   let tmp = {};
   ChromeUtils.import("resource://testing-common/TestUtils.jsm", tmp);
 
   let awaitDrop = BrowserTestUtils.waitForEvent(newWindowButton, "drop");