Bug 1522438 - Port Customizable UI tests to QuantumBar. r=mak
authorMark Banner <standard8@mozilla.com>
Tue, 26 Feb 2019 23:28:34 +0000
changeset 519293 0a3675e5f4abd788bb1a10be592d9006479a01e7
parent 519292 f590c48e0b172c2e1a9d128f7711be0d794e9b63
child 519294 af366b1dc82e5eab80a35459fff6f8d94b003999
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1522438
milestone67.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 1522438 - Port Customizable UI tests to QuantumBar. r=mak Differential Revision: https://phabricator.services.mozilla.com/D21031
browser/components/customizableui/test/browser_947914_button_copy.js
browser/components/customizableui/test/browser_947914_button_cut.js
browser/components/customizableui/test/browser_editcontrols_update.js
browser/components/customizableui/test/browser_insert_before_moved_node.js
--- a/browser/components/customizableui/test/browser_947914_button_copy.js
+++ b/browser/components/customizableui/test/browser_947914_button_copy.js
@@ -22,16 +22,17 @@ add_task(async function() {
     info("Menu panel was opened");
 
     let copyButton = document.getElementById("copy-button");
     ok(copyButton, "Copy button exists in Panel Menu");
     ok(copyButton.getAttribute("disabled"), "Copy button is initially disabled");
 
     // copy text from URL bar
     gURLBar.value = testText;
+    gURLBar.valueIsTyped = true;
     gURLBar.focus();
     gURLBar.select();
     await document.getElementById("nav-bar").overflowable.show();
     info("Menu panel was opened");
 
     ok(!copyButton.hasAttribute("disabled"), "Copy button is enabled when selecting");
 
     await SimpleTest.promiseClipboardChange(testText, () => {
--- a/browser/components/customizableui/test/browser_947914_button_cut.js
+++ b/browser/components/customizableui/test/browser_947914_button_cut.js
@@ -21,16 +21,17 @@ add_task(async function() {
     info("Menu panel was opened");
 
     let cutButton = document.getElementById("cut-button");
     ok(cutButton, "Cut button exists in Panel Menu");
     ok(cutButton.hasAttribute("disabled"), "Cut button is disabled");
 
     // cut text from URL bar
     gURLBar.value = testText;
+    gURLBar.valueIsTyped = true;
     gURLBar.focus();
     gURLBar.select();
     await document.getElementById("nav-bar").overflowable.show();
     info("Menu panel was opened");
 
     ok(!cutButton.hasAttribute("disabled"), "Cut button is enabled when selecting");
     await SimpleTest.promiseClipboardChange(testText, () => {
       cutButton.click();
--- a/browser/components/customizableui/test/browser_editcontrols_update.js
+++ b/browser/components/customizableui/test/browser_editcontrols_update.js
@@ -19,32 +19,32 @@ function expectCommandUpdate(count, test
       supportsCommand(cmd) { return cmd == "cmd_delete"; },
       isCommandEnabled(cmd) {
         if (!count) {
           ok(false, "unexpected update");
           reject();
         }
 
         if (!--count) {
-          testWindow.gURLBar.controllers.removeControllerAt(0, overrideController);
+          testWindow.gURLBar.inputField.controllers.removeControllerAt(0, overrideController);
           testWindow.gBrowser.selectedBrowser.controllers.removeControllerAt(0, overrideController);
           resolve(true);
         }
       },
     };
 
     if (!count) {
       SimpleTest.executeSoon(() => {
-        testWindow.gURLBar.controllers.removeControllerAt(0, overrideController);
+        testWindow.gURLBar.inputField.controllers.removeControllerAt(0, overrideController);
         testWindow.gBrowser.selectedBrowser.controllers.removeControllerAt(0, overrideController);
         resolve(false);
       });
     }
 
-    testWindow.gURLBar.controllers.insertControllerAt(0, overrideController);
+    testWindow.gURLBar.inputField.controllers.insertControllerAt(0, overrideController);
     testWindow.gBrowser.selectedBrowser.controllers.insertControllerAt(0, overrideController);
   });
 }
 
 add_task(async function test_init() {
   // Put something on the clipboard to verify that the paste button is properly enabled during the test.
   let clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
   await new Promise(resolve => {
--- a/browser/components/customizableui/test/browser_insert_before_moved_node.js
+++ b/browser/components/customizableui/test/browser_insert_before_moved_node.js
@@ -10,17 +10,17 @@ add_task(async function() {
     CustomizableUI.addWidgetToArea("real-button", toolbar);
     CustomizableUI.addWidgetToArea("moved-button-not-here", toolbar);
     let placements = CustomizableUI.getWidgetIdsInArea(toolbar);
     Assert.deepEqual(placements.slice(-2), ["real-button", "moved-button-not-here"],
       "Should have correct placements");
     let otherButton = document.createXULElement("toolbarbutton");
     otherButton.id = "moved-button-not-here";
     if (toolbar == "nav-bar") {
-      gURLBar.parentNode.appendChild(otherButton);
+      gURLBar.textbox.parentNode.appendChild(otherButton);
     } else {
       gBrowser.tabContainer.appendChild(otherButton);
     }
     CustomizableUI.destroyWidget("real-button");
     CustomizableUI.createWidget({id: "real-button", label: "test real button"});
 
     let button = document.getElementById("real-button");
     ok(button, "Button should exist");
@@ -29,9 +29,8 @@ add_task(async function() {
       is(button.parentNode, expectedContainer, "Button should be in the toolbar");
     }
 
     CustomizableUI.destroyWidget("real-button");
     otherButton.remove();
     CustomizableUI.reset();
   }
 });
-