Merge autoland to mozilla-central. a=merge
authorNoemi Erli <nerli@mozilla.com>
Mon, 01 Oct 2018 12:40:21 +0300
changeset 487271 4d1100cb4561921a56da3ce37ad189cea9e3212c
parent 487267 034d18f8ad947f9cc1e730f62ecaf5adfaac50ec (current diff)
parent 487270 6f59e128ed67ef50a35373bc808166b6c9a71c02 (diff)
child 487272 cc0bf89a7eebcc6e7a0da4275eeb19c88f886127
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersmerge
milestone64.0a1
Merge autoland to mozilla-central. a=merge
--- 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>