Bug 1459720 - Add a test that checks that we correctly launch the perf panel when pushing the button in WebIDE r=jdescottes
authorJulien Wajsberg <felash@gmail.com>
Mon, 01 Oct 2018 06:21:54 +0000
changeset 494665 6f59e128ed67ef50a35373bc808166b6c9a71c02
parent 494663 06173200ede0eff3a9a9136968d99d9f7e29d1d1
child 494666 4d1100cb4561921a56da3ce37ad189cea9e3212c
child 494673 d47b208203c898cff3172b9c05e72ee8a5dc8a4a
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)
reviewersjdescottes
bugs1459720
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
Bug 1459720 - Add a test that checks that we correctly launch the perf panel when pushing the button in WebIDE r=jdescottes Depends on D6904 Differential Revision: https://phabricator.services.mozilla.com/D6934
devtools/client/webide/test/chrome.ini
devtools/client/webide/test/test_performance_panel.html
--- 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>