Merge mozilla-central to inbound. a=merge CLOSED TREE
authorshindli <shindli@mozilla.com>
Wed, 24 Oct 2018 13:03:03 +0300
changeset 491060 3f33fb9163fcfe2fc6890808730d4a13a1769671
parent 491058 44190e77cd72ad04a263f8d8822bf3aeb267eadb (diff)
parent 491059 c29f681979ee3d1ec49a3f2563a1030cf5b8ac94 (current diff)
child 491061 8468729762b5111214f3d75f7b10f841227ad842
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmerge
milestone65.0a1
Merge mozilla-central to inbound. a=merge CLOSED TREE
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -225,17 +225,27 @@ class UrlbarInput {
 
   /**
    * Called by the view when a result is selected.
    *
    * @param {Event} event The event that selected the result.
    * @param {UrlbarMatch} result The result that was selected.
    */
   resultSelected(event, result) {
-    // TODO: Set the input value to the target url.
+    // Set the input value to the target url.
+    let val = result.url;
+    let uri;
+    try {
+      uri = Services.io.newURI(val);
+    } catch (ex) {}
+    if (uri) {
+      val = this.window.losslessDecodeURI(uri);
+    }
+    this.value = val;
+
     this.controller.resultSelected(event, result);
   }
 
   // Getters and Setters below.
 
   get focused() {
     return this.textbox.getAttribute("focused") == "true";
   }
--- a/browser/components/urlbar/tests/browser/browser_UrlbarController_resultOpening.js
+++ b/browser/components/urlbar/tests/browser/browser_UrlbarController_resultOpening.js
@@ -54,17 +54,23 @@ add_task(function test_resultSelected_sw
   sandbox.stub(window, "switchToTabHavingURI").returns(true);
   sandbox.stub(window, "isTabEmpty").returns(false);
   sandbox.stub(window.gBrowser, "removeTab");
 
   const event = new MouseEvent("click", {button: 0});
   const url = "https://example.com/1";
   const result = new UrlbarMatch(UrlbarUtils.MATCH_TYPE.TAB_SWITCH, {url});
 
-  controller.resultSelected(event, result);
+  Assert.equal(gURLBar.value, "", "urlbar input is empty before selecting a result");
+  if (Services.prefs.getBoolPref("browser.urlbar.quantumbar", true)) {
+    gURLBar.resultSelected(event, result);
+    Assert.equal(gURLBar.value, url, "urlbar value updated for selected result");
+  } else {
+    controller.resultSelected(event, result);
+  }
 
   Assert.ok(window.switchToTabHavingURI.calledOnce,
     "Should have triggered switching to the tab");
 
   let args = window.switchToTabHavingURI.args[0];
 
   Assert.equal(args[0], url, "Should have passed the expected url");
   Assert.ok(!args[1], "Should not attempt to open a new tab");
--- a/taskcluster/taskgraph/transforms/job/mozharness_test.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness_test.py
@@ -443,16 +443,17 @@ def mozharness_test_on_script_engine_aut
         'MOZHARNESS_URL': {'task-reference': mozharness_url},
         'MOZILLA_BUILD_URL': {'task-reference': installer_url},
         "MOZ_NO_REMOTE": '1',
         "XPCOM_DEBUG_BREAK": 'warn',
         "NO_FAIL_ON_TEST_ERRORS": '1',
         "MOZ_HIDE_RESULTS_TABLE": '1',
         "MOZ_NODE_PATH": "/usr/local/bin/node",
         'MOZ_AUTOMATION': '1',
+        'WORKING_DIR': '/builds/worker',
         'WORKSPACE': '/builds/worker/workspace',
         'TASKCLUSTER_WORKER_TYPE': job['worker-type'],
     }
 
     # for fetch tasks on mobile
     if 'env' in job['worker'] and 'MOZ_FETCHES' in job['worker']['env']:
         env['MOZ_FETCHES'] = job['worker']['env']['MOZ_FETCHES']
         env['MOZ_FETCHES_DIR'] = job['worker']['env']['MOZ_FETCHES_DIR']