Merge mozilla-central to inbound. a=merge CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Mon, 01 Oct 2018 12:46:24 +0300
changeset 494697 f9a8321c1ed7a38a3e9e5eb06506b875ddad2dd4
parent 494696 ee4151d16d1f71c87b8fab31de8c5d508c2d9631 (current diff)
parent 494672 cc0bf89a7eebcc6e7a0da4275eeb19c88f886127 (diff)
child 494698 6daf4f561843827556ce451941a75ab186255f00
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone64.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
Merge mozilla-central to inbound. a=merge CLOSED TREE
--- a/devtools/client/webide/test/chrome.ini
+++ b/devtools/client/webide/test/chrome.ini
@@ -36,8 +36,9 @@ skip-if = (os == "linux") # Bug 1024734
 [test_device_runtime.html]
 [test_autoconnect_runtime.html]
 [test_autoselect_project.html]
 [test_device_preferences.html]
 [test_fullscreenToolbox.html]
 [test_zoom.html]
 [test_toolbox.html]
 [test_app_validator.html]
+[test_performance_panel.html]
new file mode 100644
--- /dev/null
+++ b/devtools/client/webide/test/test_performance_panel.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf8">
+    <title></title>
+    <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+    <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
+    <script type="application/javascript" src="head.js"></script>
+    <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+  </head>
+  <body>
+    <script type="application/javascript">
+      window.onload = async function() {
+        SimpleTest.waitForExplicitFinish();
+
+        try {
+          Services.prefs.setBoolPref("devtools.performance.new-panel-enabled", true);
+
+          DebuggerServer.init();
+          DebuggerServer.registerAllActors();
+
+          const win = await openWebIDE();
+
+          const perfIframe = win.document.querySelector("#deck-panel-performance");
+          const docRuntime = getRuntimeDocument(win);
+
+          win.AppManager.update("runtime-list");
+
+          await connectToLocalRuntime(win);
+
+          const prefs = docRuntime.querySelector("#runtime-performance");
+
+          ok(!prefs.hidden, "performance button is displayed");
+          ok(!prefs.hasAttribute("disabled"), "performance cmd enabled");
+
+          const deck = win.document.querySelector("#deck");
+
+          win.Cmds.showPerformancePanel();
+          is(deck.selectedPanel, perfIframe, "performance iframe selected");
+
+          await nextTick();
+
+          await lazyIframeIsLoaded(perfIframe);
+
+          await SimpleTest.promiseWaitForCondition(
+            () => perfIframe.contentDocument.querySelector(".perf"),
+            "Waited for the react rendering that never came."
+          );
+          ok(true, "The perf interface was correctly rendered.");
+          await closeWebIDE(win);
+        } catch (e) {
+          ok(false, "Exception: " + e + "\nStack: " + e.stack);
+        } finally {
+          Services.prefs.clearUserPref("devtools.performance.new-panel-enabled");
+          SimpleTest.finish();
+        }
+      };
+    </script>
+  </body>
+</html>
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3761,17 +3761,16 @@ Tab.prototype = {
     this.browser.addEventListener("DOMWillOpenModalDialog", this, true);
     this.browser.addEventListener("pagehide", this, true);
     this.browser.addEventListener("pageshow", this, true);
     this.browser.addEventListener("MozApplicationManifest", this, true);
     this.browser.addEventListener("TabPreZombify", this, true);
     this.browser.addEventListener("DOMWindowFocus", this, true);
     this.browser.addEventListener("focusin", this, true);
     this.browser.addEventListener("focusout", this, true);
-    this.browser.addEventListener("TabSelect", this, true);
 
     // Note that the XBL binding is untrusted
     this.browser.addEventListener("VideoBindingAttached", this, true, true);
     this.browser.addEventListener("VideoBindingCast", this, true, true);
 
     Services.obs.addObserver(this, "audioFocusChanged", false);
     Services.obs.addObserver(this, "before-first-paint");
     Services.obs.addObserver(this, "media-playback");
@@ -3900,17 +3899,16 @@ Tab.prototype = {
     this.browser.removeEventListener("DOMWillOpenModalDialog", this, true);
     this.browser.removeEventListener("pagehide", this, true);
     this.browser.removeEventListener("pageshow", this, true);
     this.browser.removeEventListener("MozApplicationManifest", this, true);
     this.browser.removeEventListener("TabPreZombify", this, true);
     this.browser.removeEventListener("DOMWindowFocus", this, true);
     this.browser.removeEventListener("focusin", this, true);
     this.browser.removeEventListener("focusout", this, true);
-    this.browser.removeEventListener("TabSelect", this, true);
 
     this.browser.removeEventListener("VideoBindingAttached", this, true, true);
     this.browser.removeEventListener("VideoBindingCast", this, true, true);
 
     Services.obs.removeObserver(this, "audioFocusChanged");
     Services.obs.removeObserver(this, "before-first-paint");
     Services.obs.removeObserver(this, "media-playback");
 
@@ -4430,48 +4428,38 @@ Tab.prototype = {
           type: "Tab:Select",
           tabID: this.id,
           foreground: true,
         });
         break;
       }
 
       case "focusin": {
-        if (BrowserApp.selectedTab === this &&
-            aEvent.composedTarget instanceof HTMLInputElement) {
+        if (aEvent.composedTarget instanceof HTMLInputElement) {
           this._autoFill.onFocus(aEvent.composedTarget);
         }
         break;
       }
 
       case "focusout": {
-        if (BrowserApp.selectedTab === this &&
-            aEvent.composedTarget instanceof HTMLInputElement) {
+        if (aEvent.composedTarget instanceof HTMLInputElement) {
           this._autoFill.onFocus(null);
         }
         break;
       }
 
-      case "TabSelect": {
-        this._autoFill.clearElements();
-        this._autoFill.scanDocument(this.browser.contentDocument);
-        break;
-      }
-
       case "pagehide": {
-        if (BrowserApp.selectedTab === this &&
-            aEvent.target === this.browser.contentDocument) {
+        if (aEvent.target === this.browser.contentDocument) {
           this._autoFill.clearElements();
         }
         break;
       }
 
       case "pageshow": {
-        if (BrowserApp.selectedTab === this &&
-            aEvent.target === this.browser.contentDocument && aEvent.persisted) {
+        if (aEvent.target === this.browser.contentDocument && aEvent.persisted) {
           this._autoFill.scanDocument(aEvent.target);
         }
 
         // The rest of this only handles pageshow for the top-level document.
         if (aEvent.originalTarget.defaultView != this.browser.contentWindow)
           return;
 
         GlobalEventDispatcher.sendRequest({
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
@@ -772,16 +772,17 @@ public class SessionAccessibility {
     /* package */ void onAutoFillFocus(final GeckoBundle message) {
         if (!Settings.isEnabled() || !(mView instanceof ViewParent) || mAutoFillNodes == null) {
             return;
         }
 
         final int id;
         if (message != null) {
             id = message.getInt("id");
+            mAutoFillNodes.put(id, message);
         } else {
             id = View.NO_ID;
         }
 
         if (DEBUG) {
             Log.d(LOGTAG, "onAutoFillFocus(" + id + ')');
         }
         if (mAutoFillFocusedId == id) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
@@ -729,16 +729,17 @@ public final class SessionTextInput {
     /* package */ void onAutoFillFocus(@Nullable final GeckoBundle message) {
         if (mAutoFillRoots == null) {
             return;
         }
 
         final int id;
         if (message != null) {
             id = message.getInt("id");
+            mAutoFillNodes.put(id, message);
         } else {
             id = View.NO_ID;
         }
 
         if (DEBUG) {
             Log.d(LOGTAG, "onAutoFillFocus(" + id + ')');
         }
         if (mAutoFillFocusedId == id) {
--- a/mobile/android/modules/geckoview/GeckoViewAutoFill.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewAutoFill.jsm
@@ -62,17 +62,17 @@ class GeckoViewAutoFill {
       task.arm();
       if (!this._autoFillTasks) {
         this._autoFillTasks = new WeakMap();
       }
       this._autoFillTasks.set(aFormLike.rootElement, task);
       return;
     }
 
-    debug `Adding auto-fill ${aFormLike.rootElement.tagName}`;
+    debug `Adding auto-fill ${aFormLike}`;
 
     this._autoFillTasks.delete(aFormLike.rootElement);
 
     if (!this._autoFillInfos) {
       this._autoFillInfos = new WeakMap();
       this._autoFillElements = new Map();
     }