Bug 1345119 - Part 5: Fix eslint errors in unit tests. r=me
☠☠ backed out by 5d8420156bc2 ☠ ☠
authorGabriel Luong <gabriel.luong@gmail.com>
Thu, 23 Mar 2017 16:13:33 -0400
changeset 349188 7145d2ae3fab
parent 349187 18e9870067e4
child 349189 0c88e3aa3e3a
push id88391
push usergabriel.luong@gmail.com
push dateThu, 23 Mar 2017 20:13:41 +0000
treeherdermozilla-inbound@7145d2ae3fab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1345119
milestone55.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 1345119 - Part 5: Fix eslint errors in unit tests. r=me
devtools/server/tests/mochitest/inspector_getOffsetParent.html
devtools/server/tests/mochitest/test_inspector_getOffsetParent.html
--- a/devtools/server/tests/mochitest/inspector_getOffsetParent.html
+++ b/devtools/server/tests/mochitest/inspector_getOffsetParent.html
@@ -3,14 +3,16 @@
 <body>
     <div id="relative_parent" style="position: relative">
         <div id="absolute_child" style="position: absolute"></div>
     </div>
     <div id="static"></div>
     <div id="no_parent" style="position: absolute"></div>
     <div id="fixed" style="position: fixed"></div>
     <script>
+       "use strict";
+
        window.onload = () => {
-         window.opener.postMessage('ready', '*')
-       }
+         window.opener.postMessage("ready", "*");
+       };
      </script>
 </body>
 </html>
--- a/devtools/server/tests/mochitest/test_inspector_getOffsetParent.html
+++ b/devtools/server/tests/mochitest/test_inspector_getOffsetParent.html
@@ -6,105 +6,107 @@ https://bugzilla.mozilla.org/show_bug.cg
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1345119</title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript" src="inspector-helpers.js"></script>
   <script type="application/javascript">
-const inspector = require("devtools/shared/fronts/inspector");
+"use strict";
 
-window.onload = function() {
+window.onload = function () {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
-}
+};
 
 var gWalker;
 var gBodyNode;
 
 addTest(function setup() {
   let url = document.getElementById("inspectorContent").href;
-  attachURL(url, function(err, client, tab, doc) {
+  attachURL(url, function (err, client, tab, doc) {
     let {InspectorFront} = require("devtools/shared/fronts/inspector");
     let inspector = InspectorFront(client, tab);
 
     promiseDone(inspector.getWalker().then(walker => {
       gWalker = walker;
       return gWalker.querySelector(gWalker.rootNode, "body");
     }).then(node => {
       gBodyNode = node;
     }).then(runNextTest));
   });
 });
 
-addTest(function() {
-  info("Try to get the offset parent for a node that is absolutely positioned inside a relative node");
+addTest(function () {
+  info("Try to get the offset parent for a node that is absolutely positioned inside a " +
+    "relative node");
   gWalker.querySelector(gWalker.rootNode, "#absolute_child").then(node => {
     return gWalker.getOffsetParent(node);
   }).then(offsetParent => {
     ok(offsetParent, "The node has an offset parent");
     gWalker.querySelector(gWalker.rootNode, "#relative_parent").then(parent => {
       ok(offsetParent === parent, "The offset parent is the correct node");
       runNextTest();
     });
   });
 });
 
-addTest(function() {
-  info("Try to get the offset parent for a node that is absolutely positioned outside a relative node");
+addTest(function () {
+  info("Try to get the offset parent for a node that is absolutely positioned outside a" +
+    " relative node");
   gWalker.querySelector(gWalker.rootNode, "#no_parent").then(node => {
     return gWalker.getOffsetParent(node);
   }).then(offsetParent => {
     ok(offsetParent === gBodyNode, "The node's offset parent is the body");
     runNextTest();
   });
 });
 
-addTest(function() {
+addTest(function () {
   info("Try to get the offset parent for a relatively positioned node");
   gWalker.querySelector(gWalker.rootNode, "#relative_parent").then(node => {
     return gWalker.getOffsetParent(node);
   }).then(offsetParent => {
     ok(offsetParent === gBodyNode, "The node's offset parent is the body");
     runNextTest();
   });
 });
 
-addTest(function() {
+addTest(function () {
   info("Try to get the offset parent for a statically positioned node");
   gWalker.querySelector(gWalker.rootNode, "#static").then(node => {
     return gWalker.getOffsetParent(node);
   }).then(offsetParent => {
     ok(offsetParent === gBodyNode, "The node's offset parent is the body");
     runNextTest();
   });
 });
 
-addTest(function() {
+addTest(function () {
   info("Try to get the offset parent for a fixed positioned node");
   gWalker.querySelector(gWalker.rootNode, "#fixed").then(node => {
     return gWalker.getOffsetParent(node);
   }).then(offsetParent => {
     ok(offsetParent === gBodyNode, "The node's offset parent is the body");
     runNextTest();
   });
 });
 
-addTest(function() {
+addTest(function () {
   info("Try to get the offset parent for the body");
   gWalker.querySelector(gWalker.rootNode, "body").then(node => {
     return gWalker.getOffsetParent(node);
   }).then(offsetParent => {
     ok(!offsetParent, "The body has no offset parent");
     runNextTest();
   });
 });
 
-addTest(function() {
+addTest(function () {
   gWalker = null;
   gBodyNode = null;
   runNextTest();
 });
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1345119">Mozilla Bug 1345119</a>