Bug 1266478 - Eslint fixes followup;r=me
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 10 Jun 2016 16:51:47 -0700
changeset 377642 618a8336136754762b1002f9838fa574ffc60937
parent 377641 fb3a694a5c432916d9414b698efe1ffd0d461db1
child 377643 0201cd2703b878af094e95de65087d1f606f4650
push id20849
push userdwillcoxon@mozilla.com
push dateSat, 11 Jun 2016 05:56:04 +0000
reviewersme
bugs1266478
milestone50.0a1
Bug 1266478 - Eslint fixes followup;r=me MozReview-Commit-ID: 2BtKqZ23Qna
devtools/client/inspector/markup/test/browser_markup_copy_image_data.js
devtools/client/inspector/markup/test/browser_markup_links_04.js
devtools/client/inspector/markup/test/head.js
devtools/client/inspector/test/browser_inspector_menu-02-copy-items.js
--- a/devtools/client/inspector/markup/test/browser_markup_copy_image_data.js
+++ b/devtools/client/inspector/markup/test/browser_markup_copy_image_data.js
@@ -28,25 +28,25 @@ add_task(function* () {
   // Check again that the menu isn't available on the DIV (to make sure our
   // menu updating mechanism works)
   yield selectNode("div", inspector);
   yield assertCopyImageDataNotAvailable(inspector);
 });
 
 function* assertCopyImageDataNotAvailable(inspector) {
   let allMenuItems = openContextMenuAndGetAllItems(inspector);
-  let item = allMenuItems.find(item => item.id === "node-menu-copyimagedatauri");
+  let item = allMenuItems.find(i => i.id === "node-menu-copyimagedatauri");
 
   ok(item, "The menu item was found in the contextual menu");
   ok(item.disabled, "The menu item is disabled");
 }
 
 function* assertCopyImageDataAvailable(inspector) {
   let allMenuItems = openContextMenuAndGetAllItems(inspector);
-  let item = allMenuItems.find(item => item.id === "node-menu-copyimagedatauri");
+  let item = allMenuItems.find(i => i.id === "node-menu-copyimagedatauri");
 
   ok(item, "The menu item was found in the contextual menu");
   ok(!item.disabled, "The menu item is enabled");
 }
 
 function triggerCopyImageUrlAndWaitForClipboard(expected, inspector) {
   let def = promise.defer();
 
--- a/devtools/client/inspector/markup/test/browser_markup_links_04.js
+++ b/devtools/client/inspector/markup/test/browser_markup_links_04.js
@@ -70,17 +70,16 @@ const TEST_DATA = [{
   selector: "p[for]",
   attributeName: "for",
   popupNodeSelector: ".attr-value",
   isLinkFollowItemVisible: false,
   isLinkCopyItemVisible: false
 }];
 
 add_task(function* () {
-
   let {inspector} = yield openInspectorForURL(TEST_URL);
 
   for (let test of TEST_DATA) {
     info("Selecting test node " + test.selector);
     yield selectNode(test.selector, inspector);
 
     info("Finding the popupNode to anchor the context-menu to");
     let {editor} = yield getContainerForSelector(test.selector, inspector);
@@ -89,17 +88,17 @@ add_task(function* () {
     ok(popupNode, "Found the popupNode in attribute " + test.attributeName);
 
     info("Simulating a context click on the popupNode");
     let allMenuItems = openContextMenuAndGetAllItems(inspector, {
       target: popupNode,
     });
 
     let linkFollow = allMenuItems.find(i => i.id === "node-menu-link-follow");
-    let linkCopy =  allMenuItems.find(i => i.id === "node-menu-link-copy");
+    let linkCopy = allMenuItems.find(i => i.id === "node-menu-link-copy");
 
     // The contextual menu setup is async, because it needs to know if the
     // inspector has the resolveRelativeURL method first. So call actorHasMethod
     // here too to make sure the first call resolves first and the menu is
     // properly setup.
     yield inspector.target.actorHasMethod("inspector", "resolveRelativeURL");
 
     is(linkFollow.visible, test.isLinkFollowItemVisible,
--- a/devtools/client/inspector/markup/test/head.js
+++ b/devtools/client/inspector/markup/test/head.js
@@ -289,27 +289,25 @@ function wait(ms) {
  * @param {NodeFront} nodeFront
  * @param {InspectorPanel} inspector
  * @param {Boolean} assert Should this function run assertions inline.
  * @return A promise that resolves with a boolean indicating whether
  *         the menu items are disabled once the menu has been checked.
  */
 var isEditingMenuDisabled = Task.async(
 function* (nodeFront, inspector, assert = true) {
-  let doc = inspector.panelDoc;
-
   // To ensure clipboard contains something to paste.
   clipboard.set("<p>test</p>", "html");
 
   yield selectNode(nodeFront, inspector);
   let allMenuItems = openContextMenuAndGetAllItems(inspector);
 
-  let deleteMenuItem = allMenuItems.find(item => item.id === "node-menu-delete");
-  let editHTMLMenuItem = allMenuItems.find(item => item.id === "node-menu-edithtml");
-  let pasteHTMLMenuItem = allMenuItems.find(item => item.id === "node-menu-pasteouterhtml");
+  let deleteMenuItem = allMenuItems.find(i => i.id === "node-menu-delete");
+  let editHTMLMenuItem = allMenuItems.find(i => i.id === "node-menu-edithtml");
+  let pasteHTMLMenuItem = allMenuItems.find(i => i.id === "node-menu-pasteouterhtml");
 
   if (assert) {
     ok(deleteMenuItem.disabled, "Delete menu item is disabled");
     ok(editHTMLMenuItem.disabled, "Edit HTML menu item is disabled");
     ok(pasteHTMLMenuItem.disabled, "Paste HTML menu item is disabled");
   }
 
   return deleteMenuItem.disabled &&
@@ -323,28 +321,25 @@ function* (nodeFront, inspector, assert 
  * @param {NodeFront} nodeFront
  * @param {InspectorPanel} inspector
  * @param {Boolean} assert Should this function run assertions inline.
  * @return A promise that resolves with a boolean indicating whether
  *         the menu items are enabled once the menu has been checked.
  */
 var isEditingMenuEnabled = Task.async(
 function* (nodeFront, inspector, assert = true) {
-  let doc = inspector.panelDoc;
-
   // To ensure clipboard contains something to paste.
   clipboard.set("<p>test</p>", "html");
 
-  let menu = inspector.nodemenu;
   yield selectNode(nodeFront, inspector);
   let allMenuItems = openContextMenuAndGetAllItems(inspector);
 
-  let deleteMenuItem = allMenuItems.find(item => item.id === "node-menu-delete");
-  let editHTMLMenuItem = allMenuItems.find(item => item.id === "node-menu-edithtml");
-  let pasteHTMLMenuItem = allMenuItems.find(item => item.id === "node-menu-pasteouterhtml");
+  let deleteMenuItem = allMenuItems.find(i => i.id === "node-menu-delete");
+  let editHTMLMenuItem = allMenuItems.find(i => i.id === "node-menu-edithtml");
+  let pasteHTMLMenuItem = allMenuItems.find(i => i.id === "node-menu-pasteouterhtml");
 
   if (assert) {
     ok(!deleteMenuItem.disabled, "Delete menu item is enabled");
     ok(!editHTMLMenuItem.disabled, "Edit HTML menu item is enabled");
     ok(!pasteHTMLMenuItem.disabled, "Paste HTML menu item is enabled");
   }
 
   return !deleteMenuItem.disabled &&
--- a/devtools/client/inspector/test/browser_inspector_menu-02-copy-items.js
+++ b/devtools/client/inspector/test/browser_inspector_menu-02-copy-items.js
@@ -36,14 +36,14 @@ const COPY_ITEMS_TEST_DATA = [
 
 add_task(function* () {
   let { inspector } = yield openInspectorForURL(TEST_URL);
   for (let {desc, id, selector, text} of COPY_ITEMS_TEST_DATA) {
     info("Testing " + desc);
     yield selectNode(selector, inspector);
 
     let allMenuItems = openContextMenuAndGetAllItems(inspector);
-    let item = allMenuItems.find(item => item.id === id);
+    let item = allMenuItems.find(i => i.id === id);
     ok(item, "The popup has a " + desc + " menu item.");
 
     yield waitForClipboard(() => item.click(), text);
   }
 });