Bug 1523290 - Test for JSTerm menu in Browser Console r=nchevobbe
authorneha <ns19041997@gmail.com>
Fri, 01 Mar 2019 16:15:01 +0000
changeset 520080 f362c19c19633e5c4d9dad794b85a9ad6905b9c5
parent 520077 8cdde0ff59a15f59736e810524a649a4c8a5a7ef
child 520081 d860aa8a661bd0270ea6282a43e41e7027aea899
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)
reviewersnchevobbe
bugs1523290
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 1523290 - Test for JSTerm menu in Browser Console r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D21661
devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
--- a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
+++ b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
@@ -77,16 +77,31 @@ async function performTests() {
     "#editmenu-copy (editmenu-copy)",
     "#editmenu-paste (editmenu-paste)",
     "#editmenu-delete (editmenu-delete) [disabled]",
     "#editmenu-selectAll (editmenu-select-all) [disabled]",
   ];
   is(getL10NContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"),
     "The context menu has the correct edit menu items");
 
+  const node = hud.jsterm.inputNode || hud.jsterm.node;
+  const inputContainer = node.closest(".jsterm-input-container");
+  await openContextMenu(hud, inputContainer);
+
+  expectedContextMenu = [
+    "#editmenu-undo (editmenu-undo) [disabled]",
+    "#editmenu-cut (editmenu-cut)",
+    "#editmenu-copy (editmenu-copy)",
+    "#editmenu-paste (editmenu-paste)",
+    "#editmenu-delete (editmenu-delete) [disabled]",
+    "#editmenu-selectAll (editmenu-select-all) [disabled]",
+  ];
+  is(getL10NContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"),
+    "The context menu has the required elements");
+
   await hideContextMenu(hud);
   // Close the browser console.
   await HUDService.toggleBrowserConsole();
 }
 
 function addPrefBasedEntries(expectedEntries) {
   if (Services.prefs.getBoolPref("devtools.webconsole.sidebarToggle", false)) {
     expectedEntries.push("#console-menu-open-sidebar (V) [disabled]");